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 394486b300
commit af76ad0144
1 changed files with 7 additions and 1 deletions

View File

@ -177,7 +177,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;
}