aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/thedevstack/conversationsplus/crypto/PgpEngine.java
diff options
context:
space:
mode:
authorsteckbrief <steckbrief@chefmail.de>2016-05-13 11:23:45 +0200
committersteckbrief <steckbrief@chefmail.de>2016-05-13 11:23:45 +0200
commit351db27a77c200e526b86c318213b72cd65d1b7b (patch)
tree7802de24b0666d1a28ecffec0280d74173642d2b /src/main/java/de/thedevstack/conversationsplus/crypto/PgpEngine.java
parent70938a31a0e78203449d769fa5bda15ce73d1ed4 (diff)
parent10e607ac51dcc42fa1b54bacb698beed43750de7 (diff)
Merge branch 'master' into message_display_rework
Diffstat (limited to '')
-rw-r--r--src/main/java/de/thedevstack/conversationsplus/crypto/PgpEngine.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/main/java/de/thedevstack/conversationsplus/crypto/PgpEngine.java b/src/main/java/de/thedevstack/conversationsplus/crypto/PgpEngine.java
index 3f6f8ce7..bba52954 100644
--- a/src/main/java/de/thedevstack/conversationsplus/crypto/PgpEngine.java
+++ b/src/main/java/de/thedevstack/conversationsplus/crypto/PgpEngine.java
@@ -33,12 +33,18 @@ import de.thedevstack.conversationsplus.ui.UiCallback;
public class PgpEngine {
private OpenPgpApi api;
private XmppConnectionService mXmppConnectionService;
+ private static PgpEngine INSTANCE;
public PgpEngine(OpenPgpApi api, XmppConnectionService service) {
this.api = api;
this.mXmppConnectionService = service;
+ INSTANCE = this;
}
+ public static PgpEngine getInstance() {
+ return INSTANCE;
+ }
+
public void decrypt(final Message message, final UiCallback<Message> callback) {
Intent params = new Intent();
params.setAction(OpenPgpApi.ACTION_DECRYPT_VERIFY);
@@ -62,7 +68,7 @@ public class PgpEngine {
final HttpConnectionManager manager = mXmppConnectionService.getHttpConnectionManager();
if (message.trusted()
&& message.treatAsDownloadable() != Message.Decision.NEVER
- && ConversationsPlusPreferences.autoDownloadFileLink()
+ && (message.isHttpUploaded() || ConversationsPlusPreferences.autoDownloadFileLink())
&& ConversationsPlusPreferences.autoAcceptFileSize() > 0) {
manager.createNewDownloadConnection(message);
}