diff options
author | Christian Schneppe <christian@pix-art.de> | 2018-02-24 15:59:12 +0100 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2018-02-24 15:59:12 +0100 |
commit | 2a9689010d2dbceab46b6086d9184f9e56394c0e (patch) | |
tree | 7258bc6cb31077336924868e94251027b7db3c2a /src/main/java/de/pixart/messenger | |
parent | 8f11febe84f4d9ed3ee55dcea7ea4224ac741ef2 (diff) |
MAM: rework hasMessagesLeft to account for prosody’s missing count
Diffstat (limited to 'src/main/java/de/pixart/messenger')
-rw-r--r-- | src/main/java/de/pixart/messenger/services/MessageArchiveService.java | 18 |
1 files changed, 12 insertions, 6 deletions
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()); |