From 28676d3048eaf52260101cf6390c12479192e892 Mon Sep 17 00:00:00 2001 From: steckbrief Date: Wed, 4 Jan 2017 23:27:10 +0100 Subject: Fixed errors with notifications --- src/main/java/eu/siacs/conversations/parser/MessageParser.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/main/java/eu/siacs/conversations/parser/MessageParser.java') diff --git a/src/main/java/eu/siacs/conversations/parser/MessageParser.java b/src/main/java/eu/siacs/conversations/parser/MessageParser.java index e194f503..b68e7014 100644 --- a/src/main/java/eu/siacs/conversations/parser/MessageParser.java +++ b/src/main/java/eu/siacs/conversations/parser/MessageParser.java @@ -29,6 +29,7 @@ import eu.siacs.conversations.entities.Contact; import eu.siacs.conversations.entities.Conversation; import eu.siacs.conversations.entities.Message; import eu.siacs.conversations.entities.MucOptions; +import eu.siacs.conversations.http.HttpConnectionManager; import eu.siacs.conversations.services.AvatarService; import eu.siacs.conversations.services.MessageArchiveService; import eu.siacs.conversations.services.XmppConnectionService; @@ -470,14 +471,16 @@ public class MessageParser extends AbstractParser implements } MessageUtil.extractFileParamsFromBody(message); FileParams fileParams = message.getFileParams(); - if (message.treatAsDownloadable() != Message.Decision.NEVER) { - fileParams.setFileStatus(FileStatus.NEEDS_DOWNLOAD); + 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())) { - // Download this message in MessageAdapter + HttpConnectionManager.createNewDownloadConnection(message); } else { if (query == null) { mXmppConnectionService.getNotificationService().push(message); -- cgit v1.2.3