Relock inline encrypted

This commit is contained in:
M66B 2020-11-24 09:20:48 +01:00
parent ece233c65d
commit 620f720e7a
1 changed files with 23 additions and 0 deletions

View File

@ -3816,6 +3816,29 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
if (message == null) if (message == null)
return null; return null;
boolean inline = true;
List<EntityAttachment> attachments = db.attachment().getAttachments(message.id);
for (EntityAttachment attachment : attachments) {
if (attachment.encryption != null) {
inline = false;
break;
}
}
if (inline) {
if (message.uid == null)
return null;
EntityFolder folder = db.folder().getFolder(message.folder);
if (folder == null)
return null;
db.message().deleteMessage(id);
EntityOperation.queue(context, folder, EntityOperation.FETCH, message.uid);
return null;
}
File file = message.getFile(context); File file = message.getFile(context);
Helper.writeText(file, null); Helper.writeText(file, null);
db.message().setMessageContent(message.id, true, null, null, null, null); db.message().setMessageContent(message.id, true, null, null, null, null);