end otr session when receiving failed otr message warnings

This commit is contained in:
Daniel Gultsch 2015-07-21 11:52:49 +02:00
parent a5027104fd
commit 87bc9d3a31
1 changed files with 7 additions and 1 deletions

View File

@ -202,7 +202,13 @@ public class MessageParser extends AbstractParser implements
if (packet.getType() == MessagePacket.TYPE_ERROR) {
Jid from = packet.getFrom();
if (from != null) {
mXmppConnectionService.markMessage(account, from.toBareJid(), packet.getId(), Message.STATUS_SEND_FAILED);
Message message = mXmppConnectionService.markMessage(account,
from.toBareJid(),
packet.getId(),
Message.STATUS_SEND_FAILED);
if (message.getEncryption() == Message.ENCRYPTION_OTR) {
message.getConversation().endOtrIfNeeded();
}
}
return true;
}