diff options
Diffstat (limited to 'src/main/java/eu/siacs/conversations/services/MessageArchiveService.java')
-rw-r--r-- | src/main/java/eu/siacs/conversations/services/MessageArchiveService.java | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/main/java/eu/siacs/conversations/services/MessageArchiveService.java b/src/main/java/eu/siacs/conversations/services/MessageArchiveService.java index 3fef5703..82111243 100644 --- a/src/main/java/eu/siacs/conversations/services/MessageArchiveService.java +++ b/src/main/java/eu/siacs/conversations/services/MessageArchiveService.java @@ -24,7 +24,7 @@ public class MessageArchiveService implements OnAdvancedStreamFeaturesLoaded { private final XmppConnectionService mXmppConnectionService; private final HashSet<Query> queries = new HashSet<Query>(); - private ArrayList<Query> pendingQueries = new ArrayList<Query>(); + private final ArrayList<Query> pendingQueries = new ArrayList<Query>(); public enum PagingOrder { NORMAL, @@ -134,6 +134,7 @@ public class MessageArchiveService implements OnAdvancedStreamFeaturesLoaded { if (conversation.setLastMessageTransmitted(query.getEnd())) { this.mXmppConnectionService.databaseBackend.updateConversation(conversation); } + conversation.setHasMessagesLeftOnServer(query.getMessageCount() > 0); if (query.hasCallback()) { query.callback(); } else { @@ -300,7 +301,7 @@ public class MessageArchiveService implements OnAdvancedStreamFeaturesLoaded { public void callback() { if (this.callback != null) { this.callback.onMoreMessagesLoaded(messageCount,conversation); - if (messageCount==0) { + if (messageCount == 0) { this.callback.informUser(R.string.no_more_history_on_server); } } @@ -330,6 +331,10 @@ public class MessageArchiveService implements OnAdvancedStreamFeaturesLoaded { return this.totalCount; } + public int getMessageCount() { + return this.messageCount; + } + @Override public String toString() { StringBuilder builder = new StringBuilder(); |