aboutsummaryrefslogtreecommitdiffstats
path: root/src/eu/siacs/conversations/parser
diff options
context:
space:
mode:
authoriNPUTmice <daniel@gultsch.de>2014-09-06 18:21:31 +0200
committeriNPUTmice <daniel@gultsch.de>2014-09-06 18:21:31 +0200
commit0e5a0a07fd32d185d2d4c43df9494fafcace9208 (patch)
treee51be0fc1b2cf156327274a66589f2709c9f1e09 /src/eu/siacs/conversations/parser
parentdc0213710640911a796880fcd68a75d2b576918d (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.java9
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 0f95627d3..938ccc167 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;
}
}