diff options
author | iNPUTmice <daniel@gultsch.de> | 2014-09-06 18:21:31 +0200 |
---|---|---|
committer | iNPUTmice <daniel@gultsch.de> | 2014-09-06 18:21:31 +0200 |
commit | 0e5a0a07fd32d185d2d4c43df9494fafcace9208 (patch) | |
tree | e51be0fc1b2cf156327274a66589f2709c9f1e09 /src/eu/siacs/conversations/parser | |
parent | dc0213710640911a796880fcd68a75d2b576918d (diff) |
made otr a little bit more solid when there is no presence subscription
Diffstat (limited to 'src/eu/siacs/conversations/parser')
-rw-r--r-- | src/eu/siacs/conversations/parser/MessageParser.java | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/eu/siacs/conversations/parser/MessageParser.java b/src/eu/siacs/conversations/parser/MessageParser.java index 0f95627d..938ccc16 100644 --- a/src/eu/siacs/conversations/parser/MessageParser.java +++ b/src/eu/siacs/conversations/parser/MessageParser.java @@ -71,10 +71,13 @@ public class MessageParser extends AbstractParser implements } updateLastseen(packet, account, true); String body = packet.getBody(); + if (body.matches("^\\?OTRv\\d*\\?")) { + conversation.resetOtrSession(); + } if (!conversation.hasValidOtrSession()) { if (properlyAddressed) { conversation.startOtrSession( - mXmppConnectionService.getApplicationContext(), + mXmppConnectionService, presence, false); } else { return null; @@ -86,7 +89,7 @@ public class MessageParser extends AbstractParser implements conversation.endOtrIfNeeded(); if (properlyAddressed) { conversation.startOtrSession( - mXmppConnectionService.getApplicationContext(), + mXmppConnectionService, presence, false); } else { return null; @@ -125,7 +128,7 @@ public class MessageParser extends AbstractParser implements if (receivedId != null) { mXmppConnectionService.replyWithNotAcceptable(account, packet); } - conversation.endOtrIfNeeded(); + conversation.resetOtrSession(); return null; } } |