From 081c33b886a949f301d470199eea6be520a47832 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Tue, 4 Apr 2017 22:20:05 +0200 Subject: [PATCH] do not parse bodies with http urls as downloadable in omemo encrypted message. fixes #1756 --- .../eu/siacs/conversations/entities/Message.java | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/main/java/eu/siacs/conversations/entities/Message.java b/src/main/java/eu/siacs/conversations/entities/Message.java index a1fabec5b..318c19806 100644 --- a/src/main/java/eu/siacs/conversations/entities/Message.java +++ b/src/main/java/eu/siacs/conversations/entities/Message.java @@ -665,16 +665,15 @@ public class Message extends AbstractEntity { } if (!url.getProtocol().equalsIgnoreCase("http") && !url.getProtocol().equalsIgnoreCase("https")) { return Decision.NEVER; - } else if (oob) { + } else if (oob || encrypted) { return Decision.MUST; } - String extension = extractRelevantExtension(url); - if (extension == null) { - return Decision.NEVER; - } + final String extension = extractRelevantExtension(url); - if (encrypted) { - return Decision.MUST; + if (extension == null + || encryption == Message.ENCRYPTION_OTR + || encryption == Message.ENCRYPTION_AXOLOTL) { + return Decision.NEVER; } else if (Transferable.VALID_IMAGE_EXTENSIONS.contains(extension) || Transferable.WELL_KNOWN_EXTENSIONS.contains(extension)) { return Decision.SHOULD;