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.java4
-rw-r--r--src/eu/siacs/conversations/entities/Conversation.java4
-rw-r--r--src/eu/siacs/conversations/entities/Presences.java10
3 files changed, 14 insertions, 4 deletions
diff --git a/src/eu/siacs/conversations/entities/Contact.java b/src/eu/siacs/conversations/entities/Contact.java
index 8f4b6193..58f1f135 100644
--- a/src/eu/siacs/conversations/entities/Contact.java
+++ b/src/eu/siacs/conversations/entities/Contact.java
@@ -146,8 +146,8 @@ public class Contact {
}
}
- public Hashtable<String, Integer> getPresences() {
- return this.presences.getPresences();
+ public Presences getPresences() {
+ return this.presences;
}
public void updatePresence(String resource, int status) {
diff --git a/src/eu/siacs/conversations/entities/Conversation.java b/src/eu/siacs/conversations/entities/Conversation.java
index f5542925..e440b27c 100644
--- a/src/eu/siacs/conversations/entities/Conversation.java
+++ b/src/eu/siacs/conversations/entities/Conversation.java
@@ -257,14 +257,14 @@ public class Conversation extends AbstractEntity {
public void endOtrIfNeeded() {
if (this.otrSession != null) {
if (this.otrSession.getSessionStatus() == SessionStatus.ENCRYPTED) {
- Log.d("xmppService", "ending otr session with "
- + getContactJid());
try {
this.otrSession.endSession();
this.resetOtrSession();
} catch (OtrException e) {
this.resetOtrSession();
}
+ } else {
+ this.resetOtrSession();
}
}
}
diff --git a/src/eu/siacs/conversations/entities/Presences.java b/src/eu/siacs/conversations/entities/Presences.java
index fd8af573..77891648 100644
--- a/src/eu/siacs/conversations/entities/Presences.java
+++ b/src/eu/siacs/conversations/entities/Presences.java
@@ -62,4 +62,14 @@ public class Presences {
public int size() {
return presences.size();
}
+
+ public String[] asStringArray() {
+ final String[] presencesArray = new String[presences.size()];
+ presences.keySet().toArray(presencesArray);
+ return presencesArray;
+ }
+
+ public boolean has(String presence) {
+ return presences.containsKey(presence);
+ }
}