only show load more messages button when mam is available

also update ui after that button has been pressed. fixes #1695
This commit is contained in:
Daniel Gultsch 2016-02-14 23:53:17 +01:00
parent 356199978e
commit 8ccb2005b3
2 changed files with 6 additions and 1 deletions

View File

@ -1606,6 +1606,7 @@ public class ConversationActivity extends XmppActivity
public void setMessagesLoaded() {
if (mConversationFragment != null) {
mConversationFragment.setMessagesLoaded();
mConversationFragment.updateMessages();
}
}
}

View File

@ -62,6 +62,7 @@ import eu.siacs.conversations.ui.adapter.MessageAdapter.OnContactPictureClicked;
import eu.siacs.conversations.ui.adapter.MessageAdapter.OnContactPictureLongClicked;
import eu.siacs.conversations.utils.GeoHelper;
import eu.siacs.conversations.utils.UIHelper;
import eu.siacs.conversations.xmpp.XmppConnection;
import eu.siacs.conversations.xmpp.chatstate.ChatState;
import eu.siacs.conversations.xmpp.jid.Jid;
@ -1014,7 +1015,10 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa
protected void updateStatusMessages() {
synchronized (this.messageList) {
if (conversation.getLastClearHistory() != 0) {
final XmppConnection connection = conversation.getAccount().getXmppConnection();
if (conversation.getLastClearHistory() != 0
&& connection != null
&& connection.getFeatures().mam()) {
this.messageList.add(0, Message.createLoadMoreMessage(conversation));
}
if (conversation.getMode() == Conversation.MODE_SINGLE) {