diff options
author | Daniel Gultsch <daniel@gultsch.de> | 2016-02-22 20:28:58 +0100 |
---|---|---|
committer | Daniel Gultsch <daniel@gultsch.de> | 2016-02-22 20:28:58 +0100 |
commit | 689ded160718b5c73e118abe531530082b322636 (patch) | |
tree | f3ddd6aa3616db4ba98f03649c982f14c1b5ac07 /src/main | |
parent | a0d0ed34ae38f2377fdb3ad2c661b74b85f2df28 (diff) |
properly trigger show load more messages in mucs
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/eu/siacs/conversations/ui/ConversationFragment.java | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java index c652c3c0..d5c77490 100644 --- a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java +++ b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java @@ -1083,12 +1083,20 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa } private boolean showLoadMoreMessages(final Conversation c) { - final XmppConnection connection = c.getAccount().getXmppConnection(); - final boolean mam = connection != null && connection.getFeatures().mam(); + final boolean mam = hasMamSupport(c); final MessageArchiveService service = activity.xmppConnectionService.getMessageArchiveService(); return mam && (c.getLastClearHistory() != 0 || (c.countMessages() == 0 && c.hasMessagesLeftOnServer() && !service.queryInProgress(c))); } + private boolean hasMamSupport(final Conversation c) { + if (c.getMode() == Conversation.MODE_SINGLE) { + final XmppConnection connection = c.getAccount().getXmppConnection(); + return connection != null && connection.getFeatures().mam(); + } else { + return c.getMucOptions().mamSupport(); + } + } + protected void showSnackbar(final int message, final int action, final OnClickListener clickListener) { snackbar.setVisibility(View.VISIBLE); snackbar.setOnClickListener(null); |