mirror of
https://github.com/moparisthebest/Conversations
synced 2024-11-25 02:02:16 -05:00
log ending otr sessions on disconnect
This commit is contained in:
parent
6cfb14a2e4
commit
c1a55608df
@ -297,18 +297,23 @@ public class Conversation extends AbstractEntity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void endOtrIfNeeded() {
|
public boolean endOtrIfNeeded() {
|
||||||
if (this.otrSession != null) {
|
if (this.otrSession != null) {
|
||||||
if (this.otrSession.getSessionStatus() == SessionStatus.ENCRYPTED) {
|
if (this.otrSession.getSessionStatus() == SessionStatus.ENCRYPTED) {
|
||||||
try {
|
try {
|
||||||
this.otrSession.endSession();
|
this.otrSession.endSession();
|
||||||
this.resetOtrSession();
|
this.resetOtrSession();
|
||||||
|
return true;
|
||||||
} catch (OtrException e) {
|
} catch (OtrException e) {
|
||||||
this.resetOtrSession();
|
this.resetOtrSession();
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.resetOtrSession();
|
this.resetOtrSession();
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1269,7 +1269,7 @@ public class XmppConnectionService extends Service {
|
|||||||
conversation.getMucOptions().setOffline();
|
conversation.getMucOptions().setOffline();
|
||||||
conversation.deregisterWithBookmark();
|
conversation.deregisterWithBookmark();
|
||||||
Log.d(Config.LOGTAG, conversation.getAccount().getJid()
|
Log.d(Config.LOGTAG, conversation.getAccount().getJid()
|
||||||
+ " leaving muc " + conversation.getContactJid());
|
+ ": leaving muc " + conversation.getContactJid());
|
||||||
} else {
|
} else {
|
||||||
account.pendingConferenceLeaves.add(conversation);
|
account.pendingConferenceLeaves.add(conversation);
|
||||||
}
|
}
|
||||||
@ -1286,7 +1286,9 @@ public class XmppConnectionService extends Service {
|
|||||||
if (conversation.getMode() == Conversation.MODE_MULTI) {
|
if (conversation.getMode() == Conversation.MODE_MULTI) {
|
||||||
leaveMuc(conversation);
|
leaveMuc(conversation);
|
||||||
} else {
|
} else {
|
||||||
conversation.endOtrIfNeeded();
|
if (conversation.endOtrIfNeeded()) {
|
||||||
|
Log.d(Config.LOGTAG,account.getJid()+": ended otr session with "+conversation.getContactJid());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user