aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/thedevstack/conversationsplus/utils/ConversationUtil.java
diff options
context:
space:
mode:
authorsteckbrief <steckbrief@chefmail.de>2016-09-29 11:57:16 +0200
committersteckbrief <steckbrief@chefmail.de>2016-09-29 11:57:16 +0200
commit34fcdda53fa8ae1174909b62860534d2d874eb72 (patch)
tree50564c1d946ef1779567c67ad25a646b446a6403 /src/main/java/de/thedevstack/conversationsplus/utils/ConversationUtil.java
parent297bed106efdfa619d700ae44ce047d7f2663c93 (diff)
Implements FS#235: Deletion of remote files uploaded via httpupload
Diffstat (limited to 'src/main/java/de/thedevstack/conversationsplus/utils/ConversationUtil.java')
-rw-r--r--src/main/java/de/thedevstack/conversationsplus/utils/ConversationUtil.java7
1 files changed, 5 insertions, 2 deletions
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);