From 132b27adeef3ab4d305facda7dd035015b00766f Mon Sep 17 00:00:00 2001 From: steckbrief Date: Sat, 5 May 2018 20:28:04 +0200 Subject: introduces new message state model --- .../services/filetransfer/http/download/HttpRetrieveHead.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/main/java/de/thedevstack/conversationsplus/services/filetransfer/http/download/HttpRetrieveHead.java') diff --git a/src/main/java/de/thedevstack/conversationsplus/services/filetransfer/http/download/HttpRetrieveHead.java b/src/main/java/de/thedevstack/conversationsplus/services/filetransfer/http/download/HttpRetrieveHead.java index 1313bcca..62c1af59 100644 --- a/src/main/java/de/thedevstack/conversationsplus/services/filetransfer/http/download/HttpRetrieveHead.java +++ b/src/main/java/de/thedevstack/conversationsplus/services/filetransfer/http/download/HttpRetrieveHead.java @@ -10,6 +10,7 @@ import de.thedevstack.conversationsplus.http.Http; import de.thedevstack.conversationsplus.http.HttpClient; import de.thedevstack.conversationsplus.http.HttpHeadRetrievedListener; import de.thedevstack.conversationsplus.persistance.DatabaseBackend; +import de.thedevstack.conversationsplus.utils.MessageParserUtil; import de.thedevstack.conversationsplus.utils.MessageUtil; import de.thedevstack.conversationsplus.utils.UiUpdateHelper; import okhttp3.Call; @@ -36,12 +37,11 @@ public class HttpRetrieveHead implements Http, Callback { * If this code is reached and the URL is null something went wrong. * Try again to extract the file parameters from the message. */ - MessageUtil.extractFileParamsFromBody(message); + MessageParserUtil.extractFileParamsFromBody(message); this.url = (null != message.getFileParams()) ? message.getFileParams().getUrl() : null; if (null == this.url) { - message.setTreatAsDownloadable(Message.Decision.NEVER); // TODO find sth better if (null != message.getFileParams()) { - MessageUtil.setAndSaveFileStatus(message, FileStatus.UNDEFINED); + MessageUtil.setAndSaveFileStatus(message, FileStatus.NOT_FOUND); } } } @@ -89,7 +89,7 @@ public class HttpRetrieveHead implements Http, Callback { fileParams.setSize(size); fileParams.setMimeType(contentType); if (0 < size) { - fileParams.setFileStatus(FileStatus.NEEDS_DOWNLOAD); + MessageUtil.setFileStatus(message, FileStatus.NEEDS_DOWNLOAD); } DatabaseBackend.getInstance().updateMessage(message); UiUpdateHelper.updateConversationUi(); -- cgit v1.2.3