aboutsummaryrefslogtreecommitdiffstats
path: root/src/eu/siacs/conversations/utils
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel@gultsch.de>2014-03-12 19:47:42 +0100
committerDaniel Gultsch <daniel@gultsch.de>2014-03-12 19:47:42 +0100
commit848fb2ec24f645d5f4b6e7e2348ddcf6a7dcdeee (patch)
tree3e3c7f1772ebbeb11c7c0bf5b4f0a8d7a99d4fc1 /src/eu/siacs/conversations/utils
parentd943e218a4678dcb5cd18233aa58193a855c3010 (diff)
fix for otr problems
Diffstat (limited to 'src/eu/siacs/conversations/utils')
-rw-r--r--src/eu/siacs/conversations/utils/MessageParser.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/eu/siacs/conversations/utils/MessageParser.java b/src/eu/siacs/conversations/utils/MessageParser.java
index 2da0459e..136edc82 100644
--- a/src/eu/siacs/conversations/utils/MessageParser.java
+++ b/src/eu/siacs/conversations/utils/MessageParser.java
@@ -31,14 +31,16 @@ public class MessageParser {
}
public static Message parseOtrChat(MessagePacket packet, Account account, XmppConnectionService service) {
+ Log.d(LOGTAG,"otr message received: "+packet.toString());
String[] fromParts = packet.getFrom().split("/");
Conversation conversation = service.findOrCreateConversation(account, fromParts[0],false);
String body = packet.getBody();
if (!conversation.hasValidOtrSession()) {
conversation.startOtrSession(service.getApplicationContext(), fromParts[1]);
} else {
- if (body.startsWith("?OTRv")) {
- Log.d("xmppService","new otr during existing otr session requested. ending old one");
+ String foreignPresence = conversation.getOtrSession().getSessionID().getUserID();
+ if (!foreignPresence.equals(fromParts[1])) {
+ Log.d(LOGTAG,"new otr during existing otr session requested. ending old one");
try {
conversation.getOtrSession().endSession();
} catch (OtrException e) {