Prevent downloading of sub attachments

pull/187/head
M66B 4 years ago
parent 1cef1236af
commit 4fd8d5c48f

@ -1448,6 +1448,8 @@ class Core {
attachment = db.attachment().getAttachment(message.id, (int) id); // legacy attachment = db.attachment().getAttachment(message.id, (int) id); // legacy
if (attachment == null) if (attachment == null)
throw new IllegalArgumentException("Local attachment not found"); throw new IllegalArgumentException("Local attachment not found");
if (attachment.subsequence != null)
throw new IllegalArgumentException("Download of sub attachment");
if (attachment.available) if (attachment.available)
return; return;
@ -2093,6 +2095,7 @@ class Core {
parts.getWarnings(message.warning)); parts.getWarnings(message.warning));
for (EntityAttachment attachment : parts.getAttachments()) for (EntityAttachment attachment : parts.getAttachments())
if (attachment.subsequence == null)
parts.downloadAttachment(context, attachment); parts.downloadAttachment(context, attachment);
if (message.received > account.created) if (message.received > account.created)

Loading…
Cancel
Save