From 4bbf2dab995d5901774896e8946b48032605ec9f Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Wed, 12 Apr 2017 20:53:19 +0200 Subject: [PATCH] include RSM max in mam query in case server doesn't specify own max --- .../java/eu/siacs/conversations/generator/IqGenerator.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/eu/siacs/conversations/generator/IqGenerator.java b/src/main/java/eu/siacs/conversations/generator/IqGenerator.java index dc292ae07..246430c59 100644 --- a/src/main/java/eu/siacs/conversations/generator/IqGenerator.java +++ b/src/main/java/eu/siacs/conversations/generator/IqGenerator.java @@ -250,11 +250,13 @@ public class IqGenerator extends AbstractGenerator { data.put("end", getTimestamp(mam.getEnd())); data.submit(); query.addChild(data); + Element set = query.addChild("set", "http://jabber.org/protocol/rsm"); if (mam.getPagingOrder() == MessageArchiveService.PagingOrder.REVERSE) { - query.addChild("set", "http://jabber.org/protocol/rsm").addChild("before").setContent(mam.getReference()); + set.addChild("before").setContent(mam.getReference()); } else if (mam.getReference() != null) { - query.addChild("set", "http://jabber.org/protocol/rsm").addChild("after").setContent(mam.getReference()); + set.addChild("after").setContent(mam.getReference()); } + set.addChild("max").setContent(String.valueOf(Config.PAGE_SIZE)); return packet; } public IqPacket generateGetBlockList() {