aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/pixart/messenger
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel@gultsch.de>2016-08-13 12:43:06 +0200
committerChristian Schneppe <christian@pix-art.de>2016-08-13 22:22:51 +0200
commit6343d4c2083c4b09ca2f7a6cd42b6fe342c5ff7c (patch)
tree63a3510e2e6d744696adca270a2583be8eb587b2 /src/main/java/de/pixart/messenger
parentfa2f14cdd3c58f4f00bc97b936ea4530ad985729 (diff)
don't close otr session on every presence change
Diffstat (limited to 'src/main/java/de/pixart/messenger')
-rw-r--r--src/main/java/de/pixart/messenger/services/XmppConnectionService.java13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/main/java/de/pixart/messenger/services/XmppConnectionService.java b/src/main/java/de/pixart/messenger/services/XmppConnectionService.java
index ba471990e..230a3af91 100644
--- a/src/main/java/de/pixart/messenger/services/XmppConnectionService.java
+++ b/src/main/java/de/pixart/messenger/services/XmppConnectionService.java
@@ -195,15 +195,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();
}
}
}