diff --git a/src/eu/siacs/conversations/entities/Conversation.java b/src/eu/siacs/conversations/entities/Conversation.java index 5f204ec2763ad99316e204e700d7d78a3f4bb283..e29981fd9d1b3a5d44d299b9639f4cd9c4935453 100644 --- a/src/eu/siacs/conversations/entities/Conversation.java +++ b/src/eu/siacs/conversations/entities/Conversation.java @@ -297,18 +297,23 @@ public class Conversation extends AbstractEntity { } } - public void endOtrIfNeeded() { + public boolean endOtrIfNeeded() { if (this.otrSession != null) { if (this.otrSession.getSessionStatus() == SessionStatus.ENCRYPTED) { try { this.otrSession.endSession(); this.resetOtrSession(); + return true; } catch (OtrException e) { this.resetOtrSession(); + return false; } } else { this.resetOtrSession(); + return false; } + } else { + return false; } } diff --git a/src/eu/siacs/conversations/services/XmppConnectionService.java b/src/eu/siacs/conversations/services/XmppConnectionService.java index 33bddae6e515773aeab651f2466ff1f9460a57b2..2ee4fc796b3f3e9ebc3d5fd062ffd5cbdea38f90 100644 --- a/src/eu/siacs/conversations/services/XmppConnectionService.java +++ b/src/eu/siacs/conversations/services/XmppConnectionService.java @@ -1269,7 +1269,7 @@ public class XmppConnectionService extends Service { conversation.getMucOptions().setOffline(); conversation.deregisterWithBookmark(); Log.d(Config.LOGTAG, conversation.getAccount().getJid() - + " leaving muc " + conversation.getContactJid()); + + ": leaving muc " + conversation.getContactJid()); } else { account.pendingConferenceLeaves.add(conversation); } @@ -1286,7 +1286,9 @@ public class XmppConnectionService extends Service { if (conversation.getMode() == Conversation.MODE_MULTI) { leaveMuc(conversation); } else { - conversation.endOtrIfNeeded(); + if (conversation.endOtrIfNeeded()) { + Log.d(Config.LOGTAG,account.getJid()+": ended otr session with "+conversation.getContactJid()); + } } } }