From 34fcdda53fa8ae1174909b62860534d2d874eb72 Mon Sep 17 00:00:00 2001 From: steckbrief Date: Thu, 29 Sep 2016 11:57:16 +0200 Subject: Implements FS#235: Deletion of remote files uploaded via httpupload --- .../de/thedevstack/conversationsplus/utils/ConversationUtil.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/main/java/de/thedevstack/conversationsplus/utils/ConversationUtil.java') diff --git a/src/main/java/de/thedevstack/conversationsplus/utils/ConversationUtil.java b/src/main/java/de/thedevstack/conversationsplus/utils/ConversationUtil.java index 77c2c728..55fd1b8e 100644 --- a/src/main/java/de/thedevstack/conversationsplus/utils/ConversationUtil.java +++ b/src/main/java/de/thedevstack/conversationsplus/utils/ConversationUtil.java @@ -6,6 +6,7 @@ import de.thedevstack.conversationsplus.ConversationsPlusApplication; import de.thedevstack.conversationsplus.crypto.PgpEngine; import de.thedevstack.conversationsplus.entities.Conversation; import de.thedevstack.conversationsplus.entities.Message; +import de.thedevstack.conversationsplus.enums.FileStatus; import de.thedevstack.conversationsplus.exceptions.FileCopyException; import de.thedevstack.conversationsplus.persistance.FileBackend; import de.thedevstack.conversationsplus.ui.UiCallback; @@ -43,10 +44,12 @@ public class ConversationUtil { message = new Message(conversation, "", conversation.getNextEncryption()); } message.setCounterpart(conversation.getNextCounterpart()); - message.setType(Message.TYPE_FILE); + //message.setType(Message.TYPE_FILE); + message.getFileParams().setFileStatus(FileStatus.NEEDS_UPLOAD); String path = FileUtils.getPath(uri); if (path != null) { - message.setRelativeFilePath(path); + message.getFileParams().setPath(path); + message.setRelativeFilePath(path); // TODO: Remove when everything is moved to fileparams MessageUtil.updateFileParams(message); if (message.getEncryption() == Message.ENCRYPTION_DECRYPTED) { PgpEngine.getInstance().encrypt(message, callback); -- cgit v1.2.3