aboutsummaryrefslogtreecommitdiffstats
path: root/src/eu/siacs/conversations/entities
diff options
context:
space:
mode:
Diffstat (limited to 'src/eu/siacs/conversations/entities')
-rw-r--r--src/eu/siacs/conversations/entities/Contact.java6
-rw-r--r--src/eu/siacs/conversations/entities/Presences.java8
2 files changed, 12 insertions, 2 deletions
diff --git a/src/eu/siacs/conversations/entities/Contact.java b/src/eu/siacs/conversations/entities/Contact.java
index 4b97cc41..132b2717 100644
--- a/src/eu/siacs/conversations/entities/Contact.java
+++ b/src/eu/siacs/conversations/entities/Contact.java
@@ -13,6 +13,7 @@ import eu.siacs.conversations.xml.Element;
import android.content.ContentValues;
import android.database.Cursor;
+import android.util.Log;
public class Contact extends AbstractEntity implements Serializable {
private static final long serialVersionUID = -4570817093119419962L;
@@ -163,11 +164,16 @@ public class Contact extends AbstractEntity implements Serializable {
public void updatePresence(String resource, int status) {
this.presences.updatePresence(resource, status);
+ Log.d("xmppService","updatingPresence for contact="+this.jid+" resource="+resource+" num="+presences.size());
}
public void removePresence(String resource) {
this.presences.removePresence(resource);
}
+
+ public void clearPresences() {
+ this.presences.clearPresences();
+ }
public int getMostAvailableStatus() {
return this.presences.getMostAvailableStatus();
diff --git a/src/eu/siacs/conversations/entities/Presences.java b/src/eu/siacs/conversations/entities/Presences.java
index 9a22e559..acbaafca 100644
--- a/src/eu/siacs/conversations/entities/Presences.java
+++ b/src/eu/siacs/conversations/entities/Presences.java
@@ -33,6 +33,10 @@ public class Presences {
this.presences.remove(resource);
}
+ public void clearPresences() {
+ this.presences.clear();
+ }
+
public int getMostAvailableStatus() {
int status = OFFLINE;
Iterator<Entry<String, Integer>> it = presences.entrySet().iterator();
@@ -54,7 +58,7 @@ public class Presences {
jObj.put("resource", entry.getKey());
jObj.put("status", entry.getValue());
} catch (JSONException e) {
-
+
}
json.put(jObj);
}
@@ -71,7 +75,7 @@ public class Presences {
jObj.getInt("status"));
}
} catch (JSONException e1) {
-
+
}
return presences;
}