end otr session if plain text message from another instance is being received

This commit is contained in:
iNPUTmice 2014-10-28 18:02:12 +01:00
parent f256a466d8
commit 962e8183f6

View file

@ -256,7 +256,6 @@ public class MessageParser extends AbstractParser implements
return null; return null;
} }
} }
return finishedMessage; return finishedMessage;
} }
@ -478,6 +477,14 @@ public class MessageParser extends AbstractParser implements
} }
Conversation conversation = message.getConversation(); Conversation conversation = message.getConversation();
conversation.add(message); conversation.add(message);
if (message.getStatus() == Message.STATUS_RECEIVED
&& conversation.getOtrSession() != null
&& !conversation.getOtrSession().getSessionID().getUserID()
.equals(message.getPresence())) {
conversation.endOtrIfNeeded();
}
if (packet.getType() != MessagePacket.TYPE_ERROR) { if (packet.getType() != MessagePacket.TYPE_ERROR) {
if (message.getEncryption() == Message.ENCRYPTION_NONE if (message.getEncryption() == Message.ENCRYPTION_NONE
|| mXmppConnectionService.saveEncryptedMessages()) { || mXmppConnectionService.saveEncryptedMessages()) {