parse error messages from MAM results

This commit is contained in:
Daniel Gultsch 2020-08-31 14:38:48 +02:00
parent 6590dc922f
commit 97fe9fa01f
1 changed files with 4 additions and 1 deletions

View File

@ -369,7 +369,7 @@ public class MessageParser extends AbstractParser implements OnMessagePacketRece
final Element result = MessageArchiveService.Version.findResult(original);
final MessageArchiveService.Query query = result == null ? null : mXmppConnectionService.getMessageArchiveService().findQuery(result.getAttribute("queryid"));
if (query != null && query.validFrom(original.getFrom())) {
Pair<MessagePacket, Long> f = original.getForwardedMessagePacket("result", query.version.namespace);
final Pair<MessagePacket, Long> f = original.getForwardedMessagePacket("result", query.version.namespace);
if (f == null) {
return;
}
@ -377,6 +377,9 @@ public class MessageParser extends AbstractParser implements OnMessagePacketRece
packet = f.first;
serverMsgId = result.getAttribute("id");
query.incrementMessageCount();
if (handleErrorMessage(account, packet)) {
return;
}
} else if (query != null) {
Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": received mam result from invalid sender");
return;