diff options
author | iNPUTmice <daniel@gultsch.de> | 2014-06-11 21:53:25 +0200 |
---|---|---|
committer | iNPUTmice <daniel@gultsch.de> | 2014-06-11 21:53:25 +0200 |
commit | bb9045267393b2a7765d7c121b58c5e7043b525e (patch) | |
tree | a6441672710b78e3041ece15b60481257466b9fa /src/eu/siacs/conversations/parser | |
parent | 95f1a3d57d6f4a35d4579cf93d24a7621f39cf07 (diff) |
groundwork for offline otr messages
Diffstat (limited to 'src/eu/siacs/conversations/parser')
-rw-r--r-- | src/eu/siacs/conversations/parser/MessageParser.java | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/src/eu/siacs/conversations/parser/MessageParser.java b/src/eu/siacs/conversations/parser/MessageParser.java index 046b4833..63e789a3 100644 --- a/src/eu/siacs/conversations/parser/MessageParser.java +++ b/src/eu/siacs/conversations/parser/MessageParser.java @@ -6,7 +6,6 @@ import net.java.otr4j.session.Session; import net.java.otr4j.session.SessionStatus; import android.util.Log; import eu.siacs.conversations.entities.Account; -import eu.siacs.conversations.entities.Contact; import eu.siacs.conversations.entities.Conversation; import eu.siacs.conversations.entities.Message; import eu.siacs.conversations.services.XmppConnectionService; @@ -80,21 +79,7 @@ public class MessageParser extends AbstractParser { body = otrSession.transformReceiving(body); SessionStatus after = otrSession.getSessionStatus(); if ((before != after) && (after == SessionStatus.ENCRYPTED)) { - List<Message> messages = conversation.getMessages(); - for (int i = 0; i < messages.size(); ++i) { - Message msg = messages.get(i); - if ((msg.getStatus() == Message.STATUS_UNSEND) - && (msg.getEncryption() == Message.ENCRYPTION_OTR)) { - MessagePacket outPacket = mXmppConnectionService - .prepareMessagePacket(account, msg, otrSession); - msg.setStatus(Message.STATUS_SEND); - mXmppConnectionService.databaseBackend - .updateMessage(msg); - account.getXmppConnection() - .sendMessagePacket(outPacket); - } - } - mXmppConnectionService.updateUi(conversation, false); + mXmppConnectionService.onOtrSessionEstablished(conversation); } else if ((before != after) && (after == SessionStatus.FINISHED)) { conversation.resetOtrSession(); } |