aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/eu/siacs/conversations/http/HttpConnectionManager.java
diff options
context:
space:
mode:
authorsteckbrief <steckbrief@chefmail.de>2017-01-04 19:41:20 +0100
committersteckbrief <steckbrief@chefmail.de>2017-01-04 19:41:20 +0100
commit95cb2394154a287afcd295590d741096985ff69a (patch)
tree51f0b10fa41844885fc4ec40164b80e5892e3316 /src/main/java/eu/siacs/conversations/http/HttpConnectionManager.java
parentb85035c2bf57de75280ae0b4eedeff6fbf87e9eb (diff)
Added columns to fileparams table: url, original file name, key and iv
auto download of files moved from MessageParser to MessageAdapter download and open file representation cleaned up
Diffstat (limited to 'src/main/java/eu/siacs/conversations/http/HttpConnectionManager.java')
-rw-r--r--src/main/java/eu/siacs/conversations/http/HttpConnectionManager.java12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/main/java/eu/siacs/conversations/http/HttpConnectionManager.java b/src/main/java/eu/siacs/conversations/http/HttpConnectionManager.java
index a1ad3c01..e3398f93 100644
--- a/src/main/java/eu/siacs/conversations/http/HttpConnectionManager.java
+++ b/src/main/java/eu/siacs/conversations/http/HttpConnectionManager.java
@@ -19,6 +19,7 @@ import javax.net.ssl.X509TrustManager;
import de.thedevstack.conversationsplus.ConversationsPlusApplication;
+import de.thedevstack.conversationsplus.utils.MessageUtil;
import eu.siacs.conversations.entities.Message;
import eu.siacs.conversations.services.AbstractConnectionManager;
import eu.siacs.conversations.services.XmppConnectionService;
@@ -39,10 +40,13 @@ public class HttpConnectionManager extends AbstractConnectionManager {
}
public static HttpDownloadConnection createNewDownloadConnection(Message message, boolean interactive) {
- HttpDownloadConnection connection = new HttpDownloadConnection(INSTANCE);
- connection.init(message,interactive);
- INSTANCE.downloadConnections.add(connection);
- return connection;
+ if (MessageUtil.needsDownload(message)) {
+ HttpDownloadConnection connection = new HttpDownloadConnection(INSTANCE);
+ connection.init(message, interactive);
+ INSTANCE.downloadConnections.add(connection);
+ return connection;
+ }
+ return null;
}
public void finishConnection(HttpDownloadConnection connection) {