aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2017-04-13 21:56:18 +0200
committerChristian Schneppe <christian@pix-art.de>2017-04-13 21:56:18 +0200
commit6f32449361d4592f33270835ea64de00bf1a317c (patch)
tree4bcf6839efbcfb81e293c011af7f2d917351ea0b /src/main/java/de
parente3a573c2d7b53b9e2088c8c345a0b19fbca5c1f0 (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.java6
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;
}