diff options
author | Christian Schneppe <christian@pix-art.de> | 2017-04-13 21:56:18 +0200 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2017-04-13 21:56:18 +0200 |
commit | 6f32449361d4592f33270835ea64de00bf1a317c (patch) | |
tree | 4bcf6839efbcfb81e293c011af7f2d917351ea0b /src/main/java/de | |
parent | e3a573c2d7b53b9e2088c8c345a0b19fbca5c1f0 (diff) |
include RSM max in mam query in case server doesn't specify own max
Diffstat (limited to 'src/main/java/de')
-rw-r--r-- | src/main/java/de/pixart/messenger/generator/IqGenerator.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/main/java/de/pixart/messenger/generator/IqGenerator.java b/src/main/java/de/pixart/messenger/generator/IqGenerator.java index e919b437e..301f4d178 100644 --- a/src/main/java/de/pixart/messenger/generator/IqGenerator.java +++ b/src/main/java/de/pixart/messenger/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; } |