diff options
Diffstat (limited to 'src/main/java/eu/siacs/conversations/services/XmppConnectionService.java')
-rw-r--r-- | src/main/java/eu/siacs/conversations/services/XmppConnectionService.java | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java index 456ae1ebc..3072a9aad 100644 --- a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java +++ b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java @@ -49,7 +49,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.Collections; -import java.util.Comparator; import java.util.HashMap; import java.util.HashSet; import java.util.Hashtable; @@ -62,6 +61,7 @@ import java.util.concurrent.CopyOnWriteArrayList; import de.duenndns.ssl.MemorizingTrustManager; import eu.siacs.conversations.Config; import eu.siacs.conversations.R; +import eu.siacs.conversations.crypto.PgpDecryptionService; import eu.siacs.conversations.crypto.PgpEngine; import eu.siacs.conversations.crypto.axolotl.AxolotlService; import eu.siacs.conversations.crypto.axolotl.XmppAxolotlMessage; @@ -383,6 +383,16 @@ public class XmppConnectionService extends Service { } + public OpenPgpApi getOpenPgpApi() { + if (!Config.supportOpenPgp()) { + return null; + } else if (pgpServiceConnection != null && pgpServiceConnection.isBound()) { + return new OpenPgpApi(this, pgpServiceConnection.getService()); + } else { + return null; + } + } + public FileBackend getFileBackend() { return this.fileBackend; } @@ -750,8 +760,9 @@ public class XmppConnectionService extends Service { @Override public void onBound(IOpenPgpService2 service) { for (Account account : accounts) { - if (account.getPgpDecryptionService() != null) { - account.getPgpDecryptionService().onOpenPgpServiceBound(); + final PgpDecryptionService pgp = account.getPgpDecryptionService(); + if(pgp != null) { + pgp.continueDecryption(true); } } } |