aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/main/java/de/thedevstack/conversationsplus/services/filetransfer/http/download/AutomaticFileDownload.java9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/main/java/de/thedevstack/conversationsplus/services/filetransfer/http/download/AutomaticFileDownload.java b/src/main/java/de/thedevstack/conversationsplus/services/filetransfer/http/download/AutomaticFileDownload.java
index 4401fb06..f337f23a 100644
--- a/src/main/java/de/thedevstack/conversationsplus/services/filetransfer/http/download/AutomaticFileDownload.java
+++ b/src/main/java/de/thedevstack/conversationsplus/services/filetransfer/http/download/AutomaticFileDownload.java
@@ -4,8 +4,10 @@ import de.thedevstack.android.logcat.Logging;
import de.thedevstack.conversationsplus.ConversationsPlusApplication;
import de.thedevstack.conversationsplus.ConversationsPlusPreferences;
import de.thedevstack.conversationsplus.entities.Message;
+import de.thedevstack.conversationsplus.enums.MessageStatus;
import de.thedevstack.conversationsplus.http.HttpHeadRetrievedListener;
import de.thedevstack.conversationsplus.services.filetransfer.FileTransferManager;
+import de.thedevstack.conversationsplus.utils.MessageUtil;
import de.thedevstack.conversationsplus.utils.XmppConnectionServiceAccessor;
/**
@@ -15,8 +17,9 @@ public class AutomaticFileDownload implements HttpHeadRetrievedListener {
@Override
public void onFileSizeRetrieved(long size, Message message) {
- if (!this.transferFile(message)) {
-
+ if (!this.transferFile(message)) { // file cannot be auto downloaded - but message is successfully received
+ Logging.d("http-download", "No automatic download started - but message was transmitted");
+ MessageUtil.setAndSaveMessageStatus(message, MessageStatus.TRANSMITTED);
}
}
@@ -27,7 +30,7 @@ public class AutomaticFileDownload implements HttpHeadRetrievedListener {
* @return <code>true</code> if the file transfer was successful, <code>false</code> otherwise
*/
public boolean transferFile(Message message) {
- if (this.accept(message)) {
+ if (this.accept(message)) { // link or attached file can be auto downloaded
Logging.d("http-download", "Starting automatic download");
FileTransferManager ftm = FileTransferManager.getInstance();
if (ftm.accept(message)) {