diff options
author | iNPUTmice <daniel@gultsch.de> | 2014-12-13 15:32:11 +0100 |
---|---|---|
committer | iNPUTmice <daniel@gultsch.de> | 2014-12-13 15:32:11 +0100 |
commit | 899802646cbf27622c1eef8c941a84fd60af2424 (patch) | |
tree | f17b6f19bfa8cee247f87a752408a9ae34fbac6b /src/main/java/eu/siacs/conversations/generator | |
parent | 02a89f4ce2228c2e0f528f89fa1fe850c6f50fe8 (diff) |
reverse through mam history when loading larger chuncks
Diffstat (limited to '')
-rw-r--r-- | src/main/java/eu/siacs/conversations/generator/IqGenerator.java | 6 |
1 files 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 4f87b2b0..f473d1fe 100644 --- a/src/main/java/eu/siacs/conversations/generator/IqGenerator.java +++ b/src/main/java/eu/siacs/conversations/generator/IqGenerator.java @@ -112,8 +112,10 @@ public class IqGenerator extends AbstractGenerator { data.put("start",getTimestamp(mam.getStart())); data.put("end",getTimestamp(mam.getEnd())); query.addChild(data); - if (mam.getAfter() != null) { - query.addChild("set", "http://jabber.org/protocol/rsm").addChild("after").setContent(mam.getAfter()); + if (mam.getPagingOrder() == MessageArchiveService.PagingOrder.NORMAL) { + query.addChild("set", "http://jabber.org/protocol/rsm").addChild("after").setContent(mam.getReference()); + } else { + query.addChild("set", "http://jabber.org/protocol/rsm").addChild("before").setContent(mam.getReference()); } return packet; } |