aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel@gultsch.de>2016-02-14 23:53:17 +0100
committerDaniel Gultsch <daniel@gultsch.de>2016-02-14 23:53:17 +0100
commit8ccb2005b325d1d26d74c682574008553b6879ad (patch)
tree6b2e55dc26aa4656fa107ccbfd829c4a470b9de6 /src/main/java
parent356199978eaef303cef7faa90280dafb0425af71 (diff)
only show load more messages button when mam is available
also update ui after that button has been pressed. fixes #1695
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/eu/siacs/conversations/ui/ConversationActivity.java1
-rw-r--r--src/main/java/eu/siacs/conversations/ui/ConversationFragment.java6
2 files changed, 6 insertions, 1 deletions
diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java b/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java
index 97774650..5ec2dc97 100644
--- a/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java
+++ b/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java
@@ -1606,6 +1606,7 @@ public class ConversationActivity extends XmppActivity
public void setMessagesLoaded() {
if (mConversationFragment != null) {
mConversationFragment.setMessagesLoaded();
+ mConversationFragment.updateMessages();
}
}
}
diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
index 5874adae..c555ead0 100644
--- a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
+++ b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
@@ -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) {