diff options
author | Daniel Gultsch <daniel.gultsch@rwth-aachen.de> | 2014-03-19 16:16:40 +0100 |
---|---|---|
committer | Daniel Gultsch <daniel.gultsch@rwth-aachen.de> | 2014-03-19 16:16:40 +0100 |
commit | 6be2a08f19f07e9db5da3e644c8d62102fdd27e7 (patch) | |
tree | 88a319a2b46dd82ef5b5619605eda0cfe033f13e /src/eu/siacs/conversations/entities/Presences.java | |
parent | 389d4db311f22ceb787976a6c6130bb0260610bb (diff) |
otr messages are now ignored if conversations isnt 100% sure the message is ours
Diffstat (limited to 'src/eu/siacs/conversations/entities/Presences.java')
-rw-r--r-- | src/eu/siacs/conversations/entities/Presences.java | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/eu/siacs/conversations/entities/Presences.java b/src/eu/siacs/conversations/entities/Presences.java index af7926a8b..9a22e559c 100644 --- a/src/eu/siacs/conversations/entities/Presences.java +++ b/src/eu/siacs/conversations/entities/Presences.java @@ -8,6 +8,8 @@ import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; +import eu.siacs.conversations.xml.Element; + public class Presences { public static final int CHAT = -1; @@ -73,4 +75,24 @@ public class Presences { } return presences; } + + public static int parseShow(Element show) { + if (show == null) { + return Presences.ONLINE; + } else if (show.getContent().equals("away")) { + return Presences.AWAY; + } else if (show.getContent().equals("xa")) { + return Presences.XA; + } else if (show.getContent().equals("chat")) { + return Presences.CHAT; + } else if (show.getContent().equals("dnd")) { + return Presences.DND; + } else { + return Presences.OFFLINE; + } + } + + public int size() { + return presences.size(); + } } |