diff options
Diffstat (limited to 'src/main/java/eu/siacs/conversations/entities/Account.java')
-rw-r--r-- | src/main/java/eu/siacs/conversations/entities/Account.java | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/main/java/eu/siacs/conversations/entities/Account.java b/src/main/java/eu/siacs/conversations/entities/Account.java index dec3bd1a4..33304f5c7 100644 --- a/src/main/java/eu/siacs/conversations/entities/Account.java +++ b/src/main/java/eu/siacs/conversations/entities/Account.java @@ -5,6 +5,8 @@ import android.database.Cursor; import android.os.SystemClock; import android.util.Pair; +import eu.siacs.conversations.crypto.PgpDecryptionService; + import net.java.otr4j.crypto.OtrCryptoEngineImpl; import net.java.otr4j.crypto.OtrCryptoException; @@ -19,7 +21,6 @@ import java.util.List; import java.util.concurrent.CopyOnWriteArrayList; import java.util.concurrent.CopyOnWriteArraySet; -import eu.siacs.conversations.Config; import eu.siacs.conversations.R; import eu.siacs.conversations.crypto.OtrService; import eu.siacs.conversations.crypto.PgpDecryptionService; @@ -83,6 +84,14 @@ public class Account extends AbstractEntity { return getRoster().getContact(jid); } + public boolean hasPendingPgpIntent(Conversation conversation) { + return pgpDecryptionService != null && pgpDecryptionService.hasPendingIntent(conversation); + } + + public boolean isPgpDecryptionServiceConnected() { + return pgpDecryptionService != null && pgpDecryptionService.isConnected(); + } + public enum State { DISABLED, OFFLINE, @@ -398,10 +407,10 @@ public class Account extends AbstractEntity { public void initAccountServices(final XmppConnectionService context) { this.mOtrService = new OtrService(context, this); this.axolotlService = new AxolotlService(this, context); + this.pgpDecryptionService = new PgpDecryptionService(context); if (xmppConnection != null) { xmppConnection.addOnAdvancedStreamFeaturesAvailableListener(axolotlService); } - this.pgpDecryptionService = new PgpDecryptionService(context); } public OtrService getOtrService() { @@ -409,7 +418,7 @@ public class Account extends AbstractEntity { } public PgpDecryptionService getPgpDecryptionService() { - return pgpDecryptionService; + return this.pgpDecryptionService; } public XmppConnection getXmppConnection() { |