do not run mam queries in findOrCreateConversation() when isn't available

This commit is contained in:
Daniel Gultsch 2015-01-04 18:16:55 +01:00
parent e6cd92a663
commit 3522243835
1 changed files with 7 additions and 5 deletions

View File

@ -1052,11 +1052,13 @@ public class XmppConnectionService extends Service implements OnPhoneContactsLoa
} }
this.databaseBackend.createConversation(conversation); this.databaseBackend.createConversation(conversation);
} }
if (query == null) { if (account.getXmppConnection() != null && account.getXmppConnection().getFeatures().mam()) {
this.mMessageArchiveService.query(conversation); if (query == null) {
} else { this.mMessageArchiveService.query(conversation);
if (query.getConversation() == null) { } else {
this.mMessageArchiveService.query(conversation,query.getStart()); if (query.getConversation() == null) {
this.mMessageArchiveService.query(conversation, query.getStart());
}
} }
} }
this.conversations.add(conversation); this.conversations.add(conversation);