aboutsummaryrefslogtreecommitdiffstats
path: root/src/eu
diff options
context:
space:
mode:
authoriNPUTmice <daniel@gultsch.de>2014-10-30 10:59:41 +0100
committeriNPUTmice <daniel@gultsch.de>2014-10-30 10:59:41 +0100
commit7b4f3637db8c99d84fe3c825d583bfc0fa91fada (patch)
tree3c868b40f2cf5175bc552a10c791a95568def43c /src/eu
parente4567e7a62b4ae4773844b47a6a945aa7565f5b9 (diff)
only end otr session if there is more than one contact presence. reset otherwise
Diffstat (limited to '')
-rw-r--r--src/eu/siacs/conversations/services/XmppConnectionService.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/eu/siacs/conversations/services/XmppConnectionService.java b/src/eu/siacs/conversations/services/XmppConnectionService.java
index ece110e5..be73e07f 100644
--- a/src/eu/siacs/conversations/services/XmppConnectionService.java
+++ b/src/eu/siacs/conversations/services/XmppConnectionService.java
@@ -127,7 +127,11 @@ public class XmppConnectionService extends Service {
public void onContactStatusChanged(Contact contact, boolean online) {
Conversation conversation = find(getConversations(), contact);
if (conversation != null) {
- conversation.endOtrIfNeeded();
+ if (online && contact.getPresences().size() > 1) {
+ conversation.endOtrIfNeeded();
+ } else {
+ conversation.resetOtrSession();
+ }
if (online && (contact.getPresences().size() == 1)) {
sendUnsendMessages(conversation);
}