Fixed decrypting attachments

This commit is contained in:
M66B
2019-03-10 20:26:56 +00:00
parent d1c1ebfe01
commit 759cde6bda
3 changed files with 12 additions and 7 deletions

View File

@@ -1312,11 +1312,14 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
db.attachment().deleteAttachment(a.id);
// Add decrypted attachments
attachments = parts.getAttachments();
int sequence = db.attachment().getAttachmentSequence(id);
for (EntityAttachment a : parts.getAttachments()) {
for (int index = 0; index < attachments.size(); index++) {
EntityAttachment a = attachments.get(index);
a.message = id;
a.sequence = ++sequence;
a.id = db.attachment().insertAttachment(a);
parts.downloadAttachment(context, index, a.id);
}
db.message().setMessageStored(id, new Date().getTime());