aboutsummaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel@gultsch.de>2016-08-13 12:43:06 +0200
committerDaniel Gultsch <daniel@gultsch.de>2016-08-13 12:43:06 +0200
commit343bb7ff28577ca2a5b1fa80c3e96de17eb19984 (patch)
tree690e0adbe1c0648832e8cca6c75ca737f348529a /src/main
parent94aee445e721f80bc4a4ae3572141ea6af38fe4a (diff)
don't close otr session on every presence change
Diffstat (limited to '')
-rw-r--r--src/main/java/eu/siacs/conversations/services/XmppConnectionService.java13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java
index f82285a9..2f5262de 100644
--- a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java
+++ b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java
@@ -193,15 +193,12 @@ public class XmppConnectionService extends Service {
sendUnsentMessages(conversation);
}
} else {
- if (contact.getPresences().size() >= 1) {
- if (conversation.hasValidOtrSession()) {
- String otrResource = conversation.getOtrSession().getSessionID().getUserID();
- if (!(Arrays.asList(contact.getPresences().toResourceArray()).contains(otrResource))) {
- conversation.endOtrIfNeeded();
- }
+ //check if the resource we are haveing a conversation with is still online
+ if (conversation.hasValidOtrSession()) {
+ String otrResource = conversation.getOtrSession().getSessionID().getUserID();
+ if (!(Arrays.asList(contact.getPresences().toResourceArray()).contains(otrResource))) {
+ conversation.endOtrIfNeeded();
}
- } else {
- conversation.endOtrIfNeeded();
}
}
}