From dfbc42ecd795b8e5138f3dc123cdbbf8bf685209 Mon Sep 17 00:00:00 2001 From: iNPUTmice Date: Wed, 25 Jun 2014 16:55:47 +0200 Subject: [PATCH] some fixes for otr with multiple parties --- src/eu/siacs/conversations/parser/MessageParser.java | 6 +++++- .../siacs/conversations/services/XmppConnectionService.java | 5 +++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/eu/siacs/conversations/parser/MessageParser.java b/src/eu/siacs/conversations/parser/MessageParser.java index f0615876..cd10d6c8 100644 --- a/src/eu/siacs/conversations/parser/MessageParser.java +++ b/src/eu/siacs/conversations/parser/MessageParser.java @@ -56,7 +56,7 @@ public class MessageParser extends AbstractParser { String foreignPresence = conversation.getOtrSession() .getSessionID().getUserID(); if (!foreignPresence.equals(fromParts[1])) { - conversation.resetOtrSession(); + conversation.endOtrIfNeeded(); if (properlyAddressed) { conversation.startOtrSession( mXmppConnectionService.getApplicationContext(), @@ -90,6 +90,10 @@ public class MessageParser extends AbstractParser { finishedMessage.setTime(getTimestamp(packet)); return finishedMessage; } catch (Exception e) { + String receivedId = packet.getId(); + if (receivedId!=null) { + mXmppConnectionService.replyWithError(account,packet); + } conversation.resetOtrSession(); return null; } diff --git a/src/eu/siacs/conversations/services/XmppConnectionService.java b/src/eu/siacs/conversations/services/XmppConnectionService.java index 51192432..6e36c9bc 100644 --- a/src/eu/siacs/conversations/services/XmppConnectionService.java +++ b/src/eu/siacs/conversations/services/XmppConnectionService.java @@ -1474,4 +1474,9 @@ public class XmppConnectionService extends Service { public PowerManager getPowerManager() { return this.pm; } + + public void replyWithError(Account account, MessagePacket packet) { + // TODO Auto-generated method stub + + } }