aboutsummaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
authorsaqura <saqura@saqura.eu>2015-10-05 00:37:19 +0200
committerDaniel Gultsch <daniel@gultsch.de>2015-10-06 16:23:18 +0200
commit05d0c9f4febeb5cf825f789ae617eb0c862a5235 (patch)
treef272395ce1c85df9889d29132d60050e4aaedd03 /src/main
parent403db3b0800ec0dcca5fd1f5c8d94ad1f8ee9e5d (diff)
Properly check for MUC MAM support
Only use MAM (XEP-0313) in MUCs if it is supported. This should fix #1264
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/eu/siacs/conversations/services/XmppConnectionService.java14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java
index 2f00083f..6e7cdb9d 100644
--- a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java
+++ b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java
@@ -1078,13 +1078,15 @@ public class XmppConnectionService extends Service implements OnPhoneContactsLoa
checkDeletedFiles(conversation);
callback.onMoreMessagesLoaded(messages.size(), conversation);
} else if (conversation.hasMessagesLeftOnServer()
- && account.isOnlineAndConnected()
- && account.getXmppConnection().getFeatures().mam()) {
- MessageArchiveService.Query query = getMessageArchiveService().query(conversation,0,timestamp - 1);
- if (query != null) {
- query.setCallback(callback);
+ && account.isOnlineAndConnected()) {
+ if ((conversation.getMode() == Conversation.MODE_SINGLE && account.getXmppConnection().getFeatures().mam())
+ || (conversation.getMode() == Conversation.MODE_MULTI && conversation.getMucOptions().mamSupport())) {
+ MessageArchiveService.Query query = getMessageArchiveService().query(conversation,0,timestamp - 1);
+ if (query != null) {
+ query.setCallback(callback);
+ }
+ callback.informUser(R.string.fetching_history_from_server);
}
- callback.informUser(R.string.fetching_history_from_server);
}
}
};