aboutsummaryrefslogtreecommitdiffstats
path: root/src/eu/siacs/conversations/http
diff options
context:
space:
mode:
Diffstat (limited to 'src/eu/siacs/conversations/http')
-rw-r--r--src/eu/siacs/conversations/http/HttpConnection.java13
-rw-r--r--src/eu/siacs/conversations/http/HttpConnectionManager.java2
2 files changed, 10 insertions, 5 deletions
diff --git a/src/eu/siacs/conversations/http/HttpConnection.java b/src/eu/siacs/conversations/http/HttpConnection.java
index b0c230d0..0254dc2f 100644
--- a/src/eu/siacs/conversations/http/HttpConnection.java
+++ b/src/eu/siacs/conversations/http/HttpConnection.java
@@ -12,7 +12,9 @@ import javax.net.ssl.HttpsURLConnection;
import android.content.Intent;
import android.graphics.BitmapFactory;
import android.net.Uri;
+import android.util.Log;
+import eu.siacs.conversations.Config;
import eu.siacs.conversations.entities.Downloadable;
import eu.siacs.conversations.entities.DownloadableFile;
import eu.siacs.conversations.entities.Message;
@@ -35,9 +37,14 @@ public class HttpConnection implements Downloadable {
}
@Override
- public void start() {
- changeStatus(STATUS_DOWNLOADING);
- new Thread(new FileDownloader()).start();
+ public boolean start() {
+ if (mXmppConnectionService.hasInternetConnection()) {
+ changeStatus(STATUS_DOWNLOADING);
+ new Thread(new FileDownloader()).start();
+ return true;
+ } else {
+ return false;
+ }
}
public void init(Message message) {
diff --git a/src/eu/siacs/conversations/http/HttpConnectionManager.java b/src/eu/siacs/conversations/http/HttpConnectionManager.java
index ff71d45c..9a2a2405 100644
--- a/src/eu/siacs/conversations/http/HttpConnectionManager.java
+++ b/src/eu/siacs/conversations/http/HttpConnectionManager.java
@@ -1,11 +1,9 @@
package eu.siacs.conversations.http;
-import java.net.URL;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
import eu.siacs.conversations.entities.Message;
-import eu.siacs.conversations.entities.Message.ImageParams;
import eu.siacs.conversations.services.AbstractConnectionManager;
import eu.siacs.conversations.services.XmppConnectionService;