diff options
author | Christian Schneppe <christian@pix-art.de> | 2017-04-05 20:41:28 +0200 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2017-04-05 22:21:41 +0200 |
commit | acc23261c687d7a66d772b3a92c69002e7001b94 (patch) | |
tree | cd03bd67b3142ca4a1d57ba13219d4875a30b661 /src/main/java | |
parent | ea3be7ee21abb80c9717d9be84fd1c4d3204651a (diff) |
do not parse bodies with http urls as downloadable in omemo encrypted messages
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/de/pixart/messenger/entities/Message.java | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/main/java/de/pixart/messenger/entities/Message.java b/src/main/java/de/pixart/messenger/entities/Message.java index f6c578e6c..be30ced7a 100644 --- a/src/main/java/de/pixart/messenger/entities/Message.java +++ b/src/main/java/de/pixart/messenger/entities/Message.java @@ -676,16 +676,14 @@ 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) { + final String extension = extractRelevantExtension(url); + if (extension == null + || encryption == Message.ENCRYPTION_OTR + || encryption == Message.ENCRYPTION_AXOLOTL) { return Decision.NEVER; - } - - if (encrypted) { - return Decision.MUST; } else if (Transferable.VALID_IMAGE_EXTENSIONS.contains(extension) || Transferable.WELL_KNOWN_EXTENSIONS.contains(extension)) { return Decision.SHOULD; |