aboutsummaryrefslogtreecommitdiffstats
path: root/src/eu/siacs/conversations/utils
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel.gultsch@rwth-aachen.de>2014-03-21 23:09:14 +0100
committerDaniel Gultsch <daniel.gultsch@rwth-aachen.de>2014-03-21 23:09:14 +0100
commitee1c9e611b011495f1587f5d07c464650b5749d5 (patch)
tree03d8e606636bfbe10f99e3397abc72b96a11bece /src/eu/siacs/conversations/utils
parent17960c0526902be5eac2fe6ec098c300928305c4 (diff)
more otr fixes
Diffstat (limited to 'src/eu/siacs/conversations/utils')
-rw-r--r--src/eu/siacs/conversations/utils/MessageParser.java11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/eu/siacs/conversations/utils/MessageParser.java b/src/eu/siacs/conversations/utils/MessageParser.java
index 582356787..6d644f03b 100644
--- a/src/eu/siacs/conversations/utils/MessageParser.java
+++ b/src/eu/siacs/conversations/utils/MessageParser.java
@@ -30,7 +30,6 @@ public class MessageParser {
}
public static Message parseOtrChat(MessagePacket packet, Account account, XmppConnectionService service) {
- boolean justStarted = false;
boolean properlyAddressed = (packet.getTo().split("/").length == 2) || (account.countPresences() == 1);
String[] fromParts = packet.getFrom().split("/");
Conversation conversation = service.findOrCreateConversation(account, fromParts[0],false);
@@ -38,8 +37,7 @@ public class MessageParser {
if (!conversation.hasValidOtrSession()) {
if (properlyAddressed) {
Log.d("xmppService","starting new otr session with "+packet.getFrom()+" because no valid otr session has been found");
- conversation.startOtrSession(service.getApplicationContext(), fromParts[1]);
- justStarted = true;
+ conversation.startOtrSession(service.getApplicationContext(), fromParts[1],false);
} else {
Log.d("xmppService",account.getJid()+": ignoring otr session with "+fromParts[0]);
return null;
@@ -50,8 +48,7 @@ public class MessageParser {
conversation.resetOtrSession();
if (properlyAddressed) {
Log.d("xmppService","replacing otr session with "+packet.getFrom());
- conversation.startOtrSession(service.getApplicationContext(), fromParts[1]);
- justStarted = true;
+ conversation.startOtrSession(service.getApplicationContext(), fromParts[1],false);
} else {
return null;
}
@@ -88,9 +85,7 @@ public class MessageParser {
Log.d(LOGTAG,"otr session stoped");
}
} catch (Exception e) {
- if (!justStarted) {
- conversation.resetOtrSession();
- }
+ conversation.resetOtrSession();
return null;
}