aboutsummaryrefslogtreecommitdiffstats
path: root/src/eu/siacs/conversations/entities/Presences.java
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel.gultsch@rwth-aachen.de>2014-04-16 19:14:20 +0200
committerAndreas Straub <andy@strb.org>2014-04-18 00:17:34 +0200
commita04d736f75c793dc943c1e0ce7c89e1c20a3a684 (patch)
treec1013c173338bcc6913989a3781ed275b8b350e7 /src/eu/siacs/conversations/entities/Presences.java
parent4a36abf30fb2d59934d5bfd121542fa82f5c98ce (diff)
fixed possible race conditions with presences
Diffstat (limited to '')
-rw-r--r--src/eu/siacs/conversations/entities/Presences.java8
1 files changed, 6 insertions, 2 deletions
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;
}