From c03e3b59652678721353a290449d39996faeb8fa Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Thu, 12 Jan 2017 20:56:55 +0100 Subject: [PATCH] don't include 'before' reference in mam queries bound by timestamp --- .../siacs/conversations/services/MessageArchiveService.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/eu/siacs/conversations/services/MessageArchiveService.java b/src/main/java/eu/siacs/conversations/services/MessageArchiveService.java index 39d4b44d5..a352ea8a5 100644 --- a/src/main/java/eu/siacs/conversations/services/MessageArchiveService.java +++ b/src/main/java/eu/siacs/conversations/services/MessageArchiveService.java @@ -111,7 +111,9 @@ public class MessageArchiveService implements OnAdvancedStreamFeaturesLoaded { return null; } final Query query = new Query(conversation, start, end,PagingOrder.REVERSE); - query.reference = conversation.getFirstMamReference(); + if (start==0) { + query.reference = conversation.getFirstMamReference(); + } this.queries.add(query); this.execute(query); return query;