MAM: rework hasMessagesLeft to account for prosody’s missing count
This commit is contained in:
parent
90ace36b18
commit
4013123279
|
@ -270,13 +270,19 @@ public class MessageArchiveService implements OnAdvancedStreamFeaturesLoaded {
|
||||||
query.getConversation().setFirstMamReference(first == null ? null : first.getContent());
|
query.getConversation().setFirstMamReference(first == null ? null : first.getContent());
|
||||||
}
|
}
|
||||||
if (complete || relevant == null || abort) {
|
if (complete || relevant == null || abort) {
|
||||||
boolean done = !query.isCatchup();
|
boolean done;
|
||||||
if (count != null && !query.isCatchup()) {
|
if (query.isCatchup()) {
|
||||||
|
done = false;
|
||||||
|
} else {
|
||||||
|
if (count != null) {
|
||||||
try {
|
try {
|
||||||
done = Integer.parseInt(count) <= query.getTotalCount();
|
done = Integer.parseInt(count) <= query.getTotalCount();
|
||||||
} catch (NumberFormatException e) {
|
} catch (NumberFormatException e) {
|
||||||
done = false;
|
done = false;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
done = query.getTotalCount() == 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
done = done || (query.getActualMessageCount() == 0 && !query.isCatchup());
|
done = done || (query.getActualMessageCount() == 0 && !query.isCatchup());
|
||||||
this.finalizeQuery(query, done);
|
this.finalizeQuery(query, done);
|
||||||
|
|
Loading…
Reference in a new issue