Properly check for MUC MAM support

Only use MAM (XEP-0313) in MUCs if it is supported.

This should fix #1264
This commit is contained in:
saqura 2015-10-05 00:37:19 +02:00 committed by Daniel Gultsch
parent 403db3b080
commit 05d0c9f4fe
1 changed files with 8 additions and 6 deletions

View File

@ -1078,8 +1078,9 @@ public class XmppConnectionService extends Service implements OnPhoneContactsLoa
checkDeletedFiles(conversation); checkDeletedFiles(conversation);
callback.onMoreMessagesLoaded(messages.size(), conversation); callback.onMoreMessagesLoaded(messages.size(), conversation);
} else if (conversation.hasMessagesLeftOnServer() } else if (conversation.hasMessagesLeftOnServer()
&& account.isOnlineAndConnected() && account.isOnlineAndConnected()) {
&& account.getXmppConnection().getFeatures().mam()) { 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); MessageArchiveService.Query query = getMessageArchiveService().query(conversation,0,timestamp - 1);
if (query != null) { if (query != null) {
query.setCallback(callback); query.setCallback(callback);
@ -1087,6 +1088,7 @@ public class XmppConnectionService extends Service implements OnPhoneContactsLoa
callback.informUser(R.string.fetching_history_from_server); callback.informUser(R.string.fetching_history_from_server);
} }
} }
}
}; };
mDatabaseExecutor.execute(runnable); mDatabaseExecutor.execute(runnable);
} }