do not parse bodies with http urls as downloadable in omemo encrypted message. fixes #1756

This commit is contained in:
Daniel Gultsch 2017-04-04 22:20:05 +02:00
parent b34a1f7f5e
commit 081c33b886

View file

@ -665,16 +665,15 @@ public class Message extends AbstractEntity {
} }
if (!url.getProtocol().equalsIgnoreCase("http") && !url.getProtocol().equalsIgnoreCase("https")) { if (!url.getProtocol().equalsIgnoreCase("http") && !url.getProtocol().equalsIgnoreCase("https")) {
return Decision.NEVER; return Decision.NEVER;
} else if (oob) { } else if (oob || encrypted) {
return Decision.MUST; return Decision.MUST;
} }
String extension = extractRelevantExtension(url); final String extension = extractRelevantExtension(url);
if (extension == null) {
return Decision.NEVER;
}
if (encrypted) { if (extension == null
return Decision.MUST; || encryption == Message.ENCRYPTION_OTR
|| encryption == Message.ENCRYPTION_AXOLOTL) {
return Decision.NEVER;
} else if (Transferable.VALID_IMAGE_EXTENSIONS.contains(extension) } else if (Transferable.VALID_IMAGE_EXTENSIONS.contains(extension)
|| Transferable.WELL_KNOWN_EXTENSIONS.contains(extension)) { || Transferable.WELL_KNOWN_EXTENSIONS.contains(extension)) {
return Decision.SHOULD; return Decision.SHOULD;