diff options
Diffstat (limited to '')
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/ConversationFragment.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/ConversationFragment.java b/src/main/java/de/pixart/messenger/ui/ConversationFragment.java index 7bc1a3208..db9e3981d 100644 --- a/src/main/java/de/pixart/messenger/ui/ConversationFragment.java +++ b/src/main/java/de/pixart/messenger/ui/ConversationFragment.java @@ -141,8 +141,9 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa } activity.xmppConnectionService.loadMoreMessages(conversation, timestamp, new XmppConnectionService.OnMoreMessagesLoaded() { @Override - public void onMoreMessagesLoaded(final int c, Conversation conversation) { + public void onMoreMessagesLoaded(final int c, final Conversation conversation) { if (ConversationFragment.this.conversation != conversation) { + conversation.messagesLoaded.set(true); return; } activity.runOnUiThread(new Runnable() { @@ -170,6 +171,7 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa if (messageLoaderToast != null) { messageLoaderToast.cancel(); } + conversation.messagesLoaded.set(true); } }); } @@ -1283,7 +1285,7 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa private boolean showLoadMoreMessages(final Conversation c) { final boolean mam = hasMamSupport(c); final MessageArchiveService service = activity.xmppConnectionService.getMessageArchiveService(); - return mam && (c.getLastClearHistory() != 0 || (c.countMessages() == 0 && c.hasMessagesLeftOnServer() && !service.queryInProgress(c))); + return mam && (c.getLastClearHistory() != 0 || (c.countMessages() == 0 && c.messagesLoaded.get() && c.hasMessagesLeftOnServer() && !service.queryInProgress(c))); } private boolean hasMamSupport(final Conversation c) { |