aboutsummaryrefslogtreecommitdiffstats
path: root/src/eu/siacs/conversations/http/HttpConnection.java
diff options
context:
space:
mode:
authoriNPUTmice <daniel@gultsch.de>2014-10-17 13:09:02 +0200
committeriNPUTmice <daniel@gultsch.de>2014-10-17 13:09:02 +0200
commit0605390144b85dfe3531ad47cfa276f9f5c8ba5b (patch)
treec05fbb7eb88f9dbb541ae91684060d59621afeed /src/eu/siacs/conversations/http/HttpConnection.java
parent3372e50155ac16c9eabce9a484914c2acbf391c8 (diff)
do not attempt to download images when not connected
Diffstat (limited to '')
-rw-r--r--src/eu/siacs/conversations/http/HttpConnection.java13
1 files changed, 10 insertions, 3 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) {