extend logging for not finding query

This commit is contained in:
Daniel Gultsch 2020-10-08 20:21:53 +02:00
parent fdfac102e2
commit dc72bc5bc3
1 changed files with 3 additions and 2 deletions

View File

@ -367,7 +367,8 @@ public class MessageParser extends AbstractParser implements OnMessagePacketRece
return; return;
} }
final Element result = MessageArchiveService.Version.findResult(original); final Element result = MessageArchiveService.Version.findResult(original);
final MessageArchiveService.Query query = result == null ? null : mXmppConnectionService.getMessageArchiveService().findQuery(result.getAttribute("queryid")); final String queryId = result == null ? null : result.getAttribute("queryid");
final MessageArchiveService.Query query = queryId == null ? null : mXmppConnectionService.getMessageArchiveService().findQuery(queryId);
if (query != null && query.validFrom(original.getFrom())) { if (query != null && query.validFrom(original.getFrom())) {
final Pair<MessagePacket, Long> f = original.getForwardedMessagePacket("result", query.version.namespace); final Pair<MessagePacket, Long> f = original.getForwardedMessagePacket("result", query.version.namespace);
if (f == null) { if (f == null) {
@ -381,7 +382,7 @@ public class MessageParser extends AbstractParser implements OnMessagePacketRece
return; return;
} }
} else if (query != null) { } else if (query != null) {
Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": received mam result from invalid sender"); Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": received mam result with invalid from ("+original.getFrom()+") or queryId ("+queryId+")");
return; return;
} else if (original.fromServer(account)) { } else if (original.fromServer(account)) {
Pair<MessagePacket, Long> f; Pair<MessagePacket, Long> f;