aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/thedevstack/conversationsplus/services/filetransfer/FileTransferManager.java
diff options
context:
space:
mode:
authorsteckbrief <steckbrief@chefmail.de>2017-02-06 10:01:13 +0100
committersteckbrief <steckbrief@chefmail.de>2017-02-06 10:01:13 +0100
commit754de6bb0449a577d2bb9c28cca6adf0ef9554f6 (patch)
tree279b405d94e0d86d10ed94bd34d919457944ead6 /src/main/java/de/thedevstack/conversationsplus/services/filetransfer/FileTransferManager.java
parentcd633f13b8d7327e47994bb5a000f0c0b7089e7f (diff)
relates FS#241: Implementation of http download based on okhttp
Diffstat (limited to 'src/main/java/de/thedevstack/conversationsplus/services/filetransfer/FileTransferManager.java')
-rw-r--r--src/main/java/de/thedevstack/conversationsplus/services/filetransfer/FileTransferManager.java10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/main/java/de/thedevstack/conversationsplus/services/filetransfer/FileTransferManager.java b/src/main/java/de/thedevstack/conversationsplus/services/filetransfer/FileTransferManager.java
index 2f9a819b..8d971bb2 100644
--- a/src/main/java/de/thedevstack/conversationsplus/services/filetransfer/FileTransferManager.java
+++ b/src/main/java/de/thedevstack/conversationsplus/services/filetransfer/FileTransferManager.java
@@ -9,7 +9,7 @@ import de.thedevstack.android.logcat.Logging;
import de.thedevstack.conversationsplus.Config;
import de.thedevstack.conversationsplus.entities.Message;
import de.thedevstack.conversationsplus.services.FileTransferService;
-import de.thedevstack.conversationsplus.services.filetransfer.http.upload.HttpFileTransferEntity;
+import de.thedevstack.conversationsplus.services.filetransfer.http.upload.HttpUploadFileTransferEntity;
import de.thedevstack.conversationsplus.utils.MessageUtil;
/**
@@ -73,7 +73,7 @@ public class FileTransferManager implements FileTransferStatusListener {
* @return <code>true</code> if the file transfer was successful, <code>false</code> otherwise
*/
public boolean transferFile(Message message, boolean delay) {
- Logging.d(Config.LOGTAG, "send file message");
+ Logging.d(Config.LOGTAG, "transfer file message");
boolean transferSuccessfullyStarted = false;
for (WeightedTransferService wts : this.transferServices) {
try {
@@ -91,13 +91,13 @@ public class FileTransferManager implements FileTransferStatusListener {
}
/**
- * Checks whether a message can be sent using this service or not.
+ * Checks whether a message can be sent or received using this service or not.
*
* @param message the message to be checked
* @return <code>true</code> if the message can be processed, <code>false</code> otherwise
*/
public boolean accept(Message message) {
- return message.needsUploading();
+ return message.needsUploading() || MessageUtil.needsDownload(message);
}
@Override
@@ -106,7 +106,7 @@ public class FileTransferManager implements FileTransferStatusListener {
if (null == wts) {
return;
}
- boolean delayed = (entity instanceof HttpFileTransferEntity) && ((HttpFileTransferEntity) entity).isDelayed();
+ boolean delayed = (entity instanceof HttpUploadFileTransferEntity) && ((HttpUploadFileTransferEntity) entity).isDelayed();
if (failureReason.isRecoverable()) {
wts.fileTransferService.transferFile(entity.getMessage(), delayed);
} else {