diff options
Diffstat (limited to '')
-rw-r--r-- | src/main/java/de/pixart/messenger/http/HttpDownloadConnection.java | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/main/java/de/pixart/messenger/http/HttpDownloadConnection.java b/src/main/java/de/pixart/messenger/http/HttpDownloadConnection.java index 102a11626..1074c1982 100644 --- a/src/main/java/de/pixart/messenger/http/HttpDownloadConnection.java +++ b/src/main/java/de/pixart/messenger/http/HttpDownloadConnection.java @@ -41,7 +41,7 @@ public class HttpDownloadConnection implements Transferable { private XmppConnectionService mXmppConnectionService; private URL mUrl; - private Message message; + private final Message message; private DownloadableFile file; private int mStatus = Transferable.STATUS_UNKNOWN; private boolean acceptedAutomatically = false; @@ -51,8 +51,8 @@ public class HttpDownloadConnection implements Transferable { private Method method = Method.HTTP_UPLOAD; private final SimpleDateFormat fileDateFormat = new SimpleDateFormat("yyyyMMdd_HHmmssSSS", Locale.US); - - HttpDownloadConnection(HttpConnectionManager manager) { + HttpDownloadConnection(Message message, HttpConnectionManager manager) { + this.message = message; this.mHttpConnectionManager = manager; this.mXmppConnectionService = manager.getXmppConnectionService(); this.mUseTor = mXmppConnectionService.useTorToConnect(); @@ -72,12 +72,7 @@ public class HttpDownloadConnection implements Transferable { } } - public void init(Message message) { - init(message, false); - } - - public void init(Message message, boolean interactive) { - this.message = message; + public void init(boolean interactive) { this.message.setTransferable(this); try { if (message.hasFileOnRemoteHost()) { @@ -201,6 +196,10 @@ public class HttpDownloadConnection implements Transferable { return this.mProgress; } + public Message getMessage() { + return message; + } + private class FileSizeChecker implements Runnable { private final boolean interactive; @@ -467,4 +466,4 @@ public class HttpDownloadConnection implements Transferable { } } -} +}
\ No newline at end of file |