From d94eb9309b4ab3ee1dfd3cee637b47a52223e15b Mon Sep 17 00:00:00 2001 From: steckbrief Date: Sun, 17 Apr 2016 21:08:14 +0200 Subject: DatabaseBackend updated to serve Conversatiosn Database version and Conversations+ Database version HttpUpload Flag introduced for message to identify if a link was sent after httpupload message hint for httpupload added (message parsing and message generating) --- .../java/de/thedevstack/conversationsplus/parser/MessageParser.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/main/java/de/thedevstack/conversationsplus/parser/MessageParser.java') diff --git a/src/main/java/de/thedevstack/conversationsplus/parser/MessageParser.java b/src/main/java/de/thedevstack/conversationsplus/parser/MessageParser.java index 6fb18266..4e70ab65 100644 --- a/src/main/java/de/thedevstack/conversationsplus/parser/MessageParser.java +++ b/src/main/java/de/thedevstack/conversationsplus/parser/MessageParser.java @@ -3,6 +3,7 @@ package de.thedevstack.conversationsplus.parser; import android.util.Log; import android.util.Pair; +import de.thedevstack.conversationsplus.xmpp.httpuploadim.HttpUploadHint; import de.tzur.conversations.Settings; import net.java.otr4j.session.Session; @@ -390,6 +391,7 @@ public class MessageParser extends AbstractParser implements if (serverMsgId == null) { serverMsgId = extractStanzaId(packet, isTypeGroupChat ? conversation.getJid().toBareJid() : account.getServer()); } + message.setHttpUploaded(packet.hasChild(HttpUploadHint.ELEMENT_NAME, HttpUploadHint.NAMESPACE)); message.setCounterpart(counterpart); message.setRemoteMsgId(remoteMsgId); @@ -465,7 +467,7 @@ public class MessageParser extends AbstractParser implements if (message.trusted() && message.treatAsDownloadable() != Message.Decision.NEVER && ConversationsPlusPreferences.autoAcceptFileSize() > 0 - && ConversationsPlusPreferences.autoDownloadFileLink()) { + && (message.isHttpUploaded() || ConversationsPlusPreferences.autoDownloadFileLink())) { this.mXmppConnectionService.getHttpConnectionManager().createNewDownloadConnection(message); } else { if (query == null) { -- cgit v1.2.3