Small fix

This commit is contained in:
M66B 2023-06-20 11:07:34 +02:00
parent 4b6fc3d73c
commit 1c768711d0
2 changed files with 6 additions and 3 deletions

View File

@ -2066,7 +2066,7 @@ class Core {
throw new IllegalArgumentException("Local attachment not found");
if (attachment.subsequence != null)
throw new IllegalArgumentException("Download of sub attachment");
if (attachment.available)
if (attachment.available && !delete)
return;
if (message.uid == null)
throw new IllegalArgumentException("Attachment/message uid missing");

View File

@ -525,8 +525,11 @@ public class EntityOperation {
}
}
*/
} else if (ATTACHMENT.equals(name))
db.attachment().setProgress(jargs.getLong(0), 0);
} else if (ATTACHMENT.equals(name)) {
boolean delete = jargs.optBoolean(1, false);
if (!delete)
db.attachment().setProgress(jargs.getLong(0), 0);
}
queue(context, message.account, message.folder, message.id, name, jargs);