parse 'received' carbon-copied error messages. fixes #3803

This commit is contained in:
Daniel Gultsch 2020-08-31 11:06:26 +02:00
parent 3dcb36a417
commit 064264c20b
2 changed files with 75 additions and 69 deletions

View File

@ -308,8 +308,14 @@ public class MessageParser extends AbstractParser implements OnMessagePacketRece
mXmppConnectionService.updateAccountUi(); mXmppConnectionService.updateAccountUi();
} }
private boolean handleErrorMessage(Account account, MessagePacket packet) { private boolean handleErrorMessage(final Account account, final MessagePacket packet) {
if (packet.getType() == MessagePacket.TYPE_ERROR) { if (packet.getType() == MessagePacket.TYPE_ERROR) {
if (packet.fromServer(account)) {
final Pair<MessagePacket, Long> forwarded = packet.getForwardedMessagePacket("received", "urn:xmpp:carbons:2");
if (forwarded != null) {
return handleErrorMessage(account, forwarded.first);
}
}
final Jid from = packet.getFrom(); final Jid from = packet.getFrom();
final String id = packet.getId(); final String id = packet.getId();
if (from != null && id != null) { if (from != null && id != null) {