From 2a9689010d2dbceab46b6086d9184f9e56394c0e Mon Sep 17 00:00:00 2001 From: Christian Schneppe Date: Sat, 24 Feb 2018 15:59:12 +0100 Subject: =?UTF-8?q?MAM:=20rework=20hasMessagesLeft=20to=20account=20for=20?= =?UTF-8?q?prosody=E2=80=99s=20missing=20count?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../messenger/services/MessageArchiveService.java | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'src/main/java/de/pixart/messenger') diff --git a/src/main/java/de/pixart/messenger/services/MessageArchiveService.java b/src/main/java/de/pixart/messenger/services/MessageArchiveService.java index f0d48a86f..a05cf5ad5 100644 --- a/src/main/java/de/pixart/messenger/services/MessageArchiveService.java +++ b/src/main/java/de/pixart/messenger/services/MessageArchiveService.java @@ -270,12 +270,18 @@ public class MessageArchiveService implements OnAdvancedStreamFeaturesLoaded { query.getConversation().setFirstMamReference(first == null ? null : first.getContent()); } if (complete || relevant == null || abort) { - boolean done = !query.isCatchup(); - if (count != null && !query.isCatchup()) { - try { - done = Integer.parseInt(count) <= query.getTotalCount(); - } catch (NumberFormatException e) { - done = false; + boolean done; + if (query.isCatchup()) { + done = false; + } else { + if (count != null) { + try { + done = Integer.parseInt(count) <= query.getTotalCount(); + } catch (NumberFormatException e) { + done = false; + } + } else { + done = query.getTotalCount() == 0; } } done = done || (query.getActualMessageCount() == 0 && !query.isCatchup()); -- cgit v1.2.3