aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/thedevstack/conversationsplus/parser
diff options
context:
space:
mode:
authorsteckbrief <steckbrief@chefmail.de>2017-01-05 21:05:24 +0100
committersteckbrief <steckbrief@chefmail.de>2017-01-05 21:05:24 +0100
commitc09e7f0a21f563359c69f0e4198c7563cd2d4809 (patch)
treea52009fa04da58a10bad7de19814e15e010fde7a /src/main/java/de/thedevstack/conversationsplus/parser
parent867ee316619f814e6311668d0f2b910cecdd6393 (diff)
parent2586fe2b9d745c0666656acb6beb4020805dd220 (diff)
Merge branch 'trz/rebase' into trz/rename
Diffstat (limited to 'src/main/java/de/thedevstack/conversationsplus/parser')
-rw-r--r--src/main/java/de/thedevstack/conversationsplus/parser/MessageParser.java13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/main/java/de/thedevstack/conversationsplus/parser/MessageParser.java b/src/main/java/de/thedevstack/conversationsplus/parser/MessageParser.java
index b02677a8..53fbb107 100644
--- a/src/main/java/de/thedevstack/conversationsplus/parser/MessageParser.java
+++ b/src/main/java/de/thedevstack/conversationsplus/parser/MessageParser.java
@@ -469,15 +469,18 @@ public class MessageParser extends AbstractParser implements
if (message.getEncryption() == Message.ENCRYPTION_NONE || !ConversationsPlusPreferences.dontSaveEncrypted()) {
mXmppConnectionService.databaseBackend.createMessage(message);
}
+ MessageUtil.extractFileParamsFromBody(message);
+ FileParams fileParams = message.getFileParams();
+ if (message.treatAsDownloadable() != Message.Decision.NEVER && message.treatAsDownloadable() != Message.Decision.NOT_DECIDED) {
+ if (null != fileParams) {
+ fileParams.setFileStatus(FileStatus.NEEDS_DOWNLOAD);
+ }
+ }
if (message.trusted()
&& message.treatAsDownloadable() != Message.Decision.NEVER
&& ConversationsPlusPreferences.autoAcceptFileSize() > 0
&& (message.isHttpUploaded() || ConversationsPlusPreferences.autoDownloadFileLink())) {
- FileParams fileParams = new FileParams();
- fileParams.setFileStatus(FileStatus.NEEDS_DOWNLOAD);
- fileParams.setUrl(message.getBody());
- message.setFileParams(fileParams);
- HttpConnectionManager.createNewDownloadConnection(message);
+ HttpConnectionManager.createNewDownloadConnection(message);
} else {
if (query == null) {
mXmppConnectionService.getNotificationService().push(message);