aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/eu/siacs/conversations/entities/Account.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/eu/siacs/conversations/entities/Account.java')
-rw-r--r--src/main/java/eu/siacs/conversations/entities/Account.java14
1 files changed, 11 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 3e79fccd..62c78cb6 100644
--- a/src/main/java/eu/siacs/conversations/entities/Account.java
+++ b/src/main/java/eu/siacs/conversations/entities/Account.java
@@ -6,6 +6,7 @@ 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;
@@ -20,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.axolotl.AxolotlService;
@@ -83,6 +83,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 +406,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 +417,7 @@ public class Account extends AbstractEntity {
}
public PgpDecryptionService getPgpDecryptionService() {
- return pgpDecryptionService;
+ return this.pgpDecryptionService;
}
public XmppConnection getXmppConnection() {