diff options
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.java | 10 |
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 { |