diff options
author | steckbrief <steckbrief@chefmail.de> | 2016-02-28 21:48:09 +0100 |
---|---|---|
committer | steckbrief <steckbrief@chefmail.de> | 2016-02-28 21:48:09 +0100 |
commit | cd0c6ce48e2ac36d9524908acbbc79690b193d9a (patch) | |
tree | e03621214377147d44a13917485baf16b607a11a /src/main/java/eu/siacs/conversations/services | |
parent | 8fb6204288d55f8af16ae47e32fa6c049284cadd (diff) | |
parent | c393e6089177f31683c4cecfdb359802de1b5e0c (diff) |
Merge tag '1.10.1' into trz/merge_1.10.1
Conflicts:
README.md
build.gradle
src/main/java/eu/siacs/conversations/entities/ListItem.java
src/main/java/eu/siacs/conversations/parser/MessageParser.java
src/main/java/eu/siacs/conversations/services/XmppConnectionService.java
src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
src/main/res/menu/message_context.xml
src/main/res/xml/preferences.xml
Diffstat (limited to '')
-rw-r--r-- | src/main/java/eu/siacs/conversations/services/MessageArchiveService.java | 1 | ||||
-rw-r--r-- | src/main/java/eu/siacs/conversations/services/XmppConnectionService.java | 38 |
2 files changed, 23 insertions, 16 deletions
diff --git a/src/main/java/eu/siacs/conversations/services/MessageArchiveService.java b/src/main/java/eu/siacs/conversations/services/MessageArchiveService.java index 0ca62b97..f3a1a7f9 100644 --- a/src/main/java/eu/siacs/conversations/services/MessageArchiveService.java +++ b/src/main/java/eu/siacs/conversations/services/MessageArchiveService.java @@ -230,7 +230,6 @@ public class MessageArchiveService implements OnAdvancedStreamFeaturesLoaded { this.execute(nextQuery); this.finalizeQuery(query, false); synchronized (this.queries) { - this.queries.remove(query); this.queries.add(nextQuery); } } diff --git a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java index 8f79ae32..e43ef062 100644 --- a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java +++ b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java @@ -266,7 +266,6 @@ public class XmppConnectionService extends Service implements OnPhoneContactsLoa if (mPushManagementService.available(account)) { mPushManagementService.registerPushTokenOnServer(account); } - mMessageArchiveService.executePendingQueries(account); connectMultiModeConversations(account); syncDirtyContacts(account); } @@ -280,6 +279,7 @@ public class XmppConnectionService extends Service implements OnPhoneContactsLoa mOnAccountUpdate.onAccountUpdate(); } if (account.getStatus() == Account.State.ONLINE) { + mMessageArchiveService.executePendingQueries(account); if (connection != null && connection.getFeatures().csi()) { if (checkListeners()) { Logging.d(Config.LOGTAG, account.getJid().toBareJid() + " sending csi//inactive"); @@ -351,7 +351,9 @@ public class XmppConnectionService extends Service implements OnPhoneContactsLoa } public PgpEngine getPgpEngine() { - if (pgpServiceConnection != null && pgpServiceConnection.isBound()) { + if (!Config.supportOpenPgp()) { + return null; + } else if (pgpServiceConnection != null && pgpServiceConnection.isBound()) { if (this.mPgpEngine == null) { this.mPgpEngine = new PgpEngine(new OpenPgpApi( getApplicationContext(), @@ -662,20 +664,23 @@ public class XmppConnectionService extends Service implements OnPhoneContactsLoa getContentResolver().registerContentObserver(ContactsContract.Contacts.CONTENT_URI, true, contactObserver); this.fileObserver.startWatching(); - this.pgpServiceConnection = new OpenPgpServiceConnection(getApplicationContext(), "org.sufficientlysecure.keychain", new OpenPgpServiceConnection.OnBound() { - @Override - public void onBound(IOpenPgpService2 service) { - for (Account account : accounts) { - if (account.getPgpDecryptionService() != null) { - account.getPgpDecryptionService().onOpenPgpServiceBound(); + if (Config.supportOpenPgp()) { + this.pgpServiceConnection = new OpenPgpServiceConnection(getApplicationContext(), "org.sufficientlysecure.keychain", new OpenPgpServiceConnection.OnBound() { + @Override + public void onBound(IOpenPgpService2 service) { + for (Account account : accounts) { + if (account.getPgpDecryptionService() != null) { + account.getPgpDecryptionService().onOpenPgpServiceBound(); + } } } - } - @Override - public void onError(Exception e) { } - }); - this.pgpServiceConnection.bindToService(); + @Override + public void onError(Exception e) { + } + }); + this.pgpServiceConnection.bindToService(); + } this.pm = (PowerManager) getSystemService(Context.POWER_SERVICE); this.wakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "XmppConnectionService"); @@ -1758,6 +1763,7 @@ public class XmppConnectionService extends Service implements OnPhoneContactsLoa account.pendingConferenceLeaves.remove(conversation); if (account.getStatus() == Account.State.ONLINE) { conversation.resetMucOptions(); + conversation.setHasMessagesLeftOnServer(false); fetchConferenceConfiguration(conversation, new OnConferenceConfigurationFetched() { private void join(Conversation conversation) { @@ -1792,7 +1798,6 @@ public class XmppConnectionService extends Service implements OnPhoneContactsLoa conversation.setContactJid(joinJid); databaseBackend.updateConversation(conversation); } - conversation.setHasMessagesLeftOnServer(false); if (conversation.getMucOptions().mamSupport()) { getMessageArchiveService().catchupMUC(conversation); } @@ -1810,9 +1815,12 @@ public class XmppConnectionService extends Service implements OnPhoneContactsLoa fetchConferenceConfiguration(conversation); } }); - + updateConversationUi(); } else { account.pendingConferenceJoins.add(conversation); + conversation.resetMucOptions(); + conversation.setHasMessagesLeftOnServer(false); + updateConversationUi(); } } |