diff options
author | Daniel Gultsch <daniel@gultsch.de> | 2016-08-13 12:43:06 +0200 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2016-08-13 22:22:51 +0200 |
commit | 6343d4c2083c4b09ca2f7a6cd42b6fe342c5ff7c (patch) | |
tree | 63a3510e2e6d744696adca270a2583be8eb587b2 /src | |
parent | fa2f14cdd3c58f4f00bc97b936ea4530ad985729 (diff) |
don't close otr session on every presence change
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/de/pixart/messenger/services/XmppConnectionService.java | 13 |
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(); } } } |