aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/eu/siacs/conversations/entities
diff options
context:
space:
mode:
authorfiaxh <github@lightrise.org>2015-10-15 23:21:47 +0100
committerfiaxh <github@lightrise.org>2015-10-28 19:57:11 +0000
commit29a849cb92c0dc902acd3aa54d0d2f07583bce72 (patch)
treef24dc3bfb5258c95a570d8ee54ca18b057d34602 /src/main/java/eu/siacs/conversations/entities
parentd65273ce39ab112ba95d0b852cda6717dbf33c8c (diff)
Decrypt PGP messages in background
Diffstat (limited to 'src/main/java/eu/siacs/conversations/entities')
-rw-r--r--src/main/java/eu/siacs/conversations/entities/Account.java7
-rw-r--r--src/main/java/eu/siacs/conversations/entities/Conversation.java1
2 files changed, 8 insertions, 0 deletions
diff --git a/src/main/java/eu/siacs/conversations/entities/Account.java b/src/main/java/eu/siacs/conversations/entities/Account.java
index ebfd9805..06f2264b 100644
--- a/src/main/java/eu/siacs/conversations/entities/Account.java
+++ b/src/main/java/eu/siacs/conversations/entities/Account.java
@@ -4,6 +4,7 @@ import android.content.ContentValues;
import android.database.Cursor;
import android.os.SystemClock;
+import eu.siacs.conversations.crypto.PgpDecryptionService;
import net.java.otr4j.crypto.OtrCryptoEngineImpl;
import net.java.otr4j.crypto.OtrCryptoException;
@@ -127,6 +128,7 @@ public class Account extends AbstractEntity {
protected boolean online = false;
private OtrService mOtrService = null;
private AxolotlService axolotlService = null;
+ private PgpDecryptionService pgpDecryptionService = null;
private XmppConnection xmppConnection = null;
private long mEndGracePeriod = 0L;
private String otrFingerprint;
@@ -300,12 +302,17 @@ public class Account extends AbstractEntity {
if (xmppConnection != null) {
xmppConnection.addOnAdvancedStreamFeaturesAvailableListener(axolotlService);
}
+ this.pgpDecryptionService = new PgpDecryptionService(context);
}
public OtrService getOtrService() {
return this.mOtrService;
}
+ public PgpDecryptionService getPgpDecryptionService() {
+ return pgpDecryptionService;
+ }
+
public XmppConnection getXmppConnection() {
return this.xmppConnection;
}
diff --git a/src/main/java/eu/siacs/conversations/entities/Conversation.java b/src/main/java/eu/siacs/conversations/entities/Conversation.java
index 5f3f1a6e..473ef0fe 100644
--- a/src/main/java/eu/siacs/conversations/entities/Conversation.java
+++ b/src/main/java/eu/siacs/conversations/entities/Conversation.java
@@ -777,6 +777,7 @@ public class Conversation extends AbstractEntity implements Blockable {
synchronized (this.messages) {
this.messages.addAll(index, messages);
}
+ account.getPgpDecryptionService().addAll(messages);
}
public void sort() {