diff options
author | steckbrief <steckbrief@chefmail.de> | 2017-02-06 10:01:13 +0100 |
---|---|---|
committer | steckbrief <steckbrief@chefmail.de> | 2017-02-06 10:01:13 +0100 |
commit | 754de6bb0449a577d2bb9c28cca6adf0ef9554f6 (patch) | |
tree | 279b405d94e0d86d10ed94bd34d919457944ead6 /src/main/java/de/thedevstack/conversationsplus/ui/ConversationActivity.java | |
parent | cd633f13b8d7327e47994bb5a000f0c0b7089e7f (diff) |
relates FS#241: Implementation of http download based on okhttp
Diffstat (limited to '')
-rw-r--r-- | src/main/java/de/thedevstack/conversationsplus/ui/ConversationActivity.java | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/main/java/de/thedevstack/conversationsplus/ui/ConversationActivity.java b/src/main/java/de/thedevstack/conversationsplus/ui/ConversationActivity.java index bca0851a..ce1eb439 100644 --- a/src/main/java/de/thedevstack/conversationsplus/ui/ConversationActivity.java +++ b/src/main/java/de/thedevstack/conversationsplus/ui/ConversationActivity.java @@ -44,6 +44,7 @@ import java.util.List; import java.util.concurrent.atomic.AtomicBoolean; import de.thedevstack.android.logcat.Logging; +import de.thedevstack.conversationsplus.services.filetransfer.FileTransferManager; import de.thedevstack.conversationsplus.utils.AccountUtil; import de.timroes.android.listview.EnhancedListView; @@ -59,8 +60,6 @@ import de.thedevstack.conversationsplus.entities.Contact; import de.thedevstack.conversationsplus.entities.Conversation; import de.thedevstack.conversationsplus.entities.Message; import de.thedevstack.conversationsplus.entities.Transferable; -import de.thedevstack.conversationsplus.http.HttpConnectionManager; -import de.thedevstack.conversationsplus.http.HttpDownloadConnection; import de.thedevstack.conversationsplus.persistance.FileBackend; import de.thedevstack.conversationsplus.services.XmppConnectionService; import de.thedevstack.conversationsplus.services.XmppConnectionService.OnAccountUpdate; @@ -624,8 +623,12 @@ public class ConversationActivity extends XmppActivity Toast.makeText(this, R.string.not_connected_try_again, Toast.LENGTH_SHORT).show(); } } else if (message.treatAsDownloadable() != Message.Decision.NEVER) { - HttpDownloadConnection downloadConnection = HttpConnectionManager.createNewDownloadConnection(message, true); - if (null == downloadConnection) { + FileTransferManager ftm = FileTransferManager.getInstance(); + boolean created = false; + if (ftm.accept(message)) { + created = ftm.transferFile(message); + } + if (!created) { Toast.makeText(this, R.string.file_not_on_remote_host, Toast.LENGTH_LONG).show(); } } |