MAM: rework hasMessagesLeft to account for prosody’s missing count
This commit is contained in:
parent
8f11febe84
commit
2a9689010d
1 changed files with 12 additions and 6 deletions
|
@ -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());
|
||||
|
|
Reference in a new issue