|
|
@ -2148,8 +2148,7 @@ class Core {
|
|
|
|
int sequence = 1;
|
|
|
|
int sequence = 1;
|
|
|
|
|
|
|
|
|
|
|
|
String autocrypt = helper.getAutocrypt();
|
|
|
|
String autocrypt = helper.getAutocrypt();
|
|
|
|
if (autocrypt != null)
|
|
|
|
if (autocrypt != null) {
|
|
|
|
try {
|
|
|
|
|
|
|
|
EntityAttachment attachment = new EntityAttachment();
|
|
|
|
EntityAttachment attachment = new EntityAttachment();
|
|
|
|
attachment.message = message.id;
|
|
|
|
attachment.message = message.id;
|
|
|
|
attachment.sequence = sequence++;
|
|
|
|
attachment.sequence = sequence++;
|
|
|
@ -2158,6 +2157,7 @@ class Core {
|
|
|
|
attachment.disposition = Part.ATTACHMENT;
|
|
|
|
attachment.disposition = Part.ATTACHMENT;
|
|
|
|
attachment.id = db.attachment().insertAttachment(attachment);
|
|
|
|
attachment.id = db.attachment().insertAttachment(attachment);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
byte[] b = Base64.decode(autocrypt, Base64.DEFAULT);
|
|
|
|
byte[] b = Base64.decode(autocrypt, Base64.DEFAULT);
|
|
|
|
|
|
|
|
|
|
|
|
File file = attachment.getFile(context);
|
|
|
|
File file = attachment.getFile(context);
|
|
|
@ -2170,6 +2170,9 @@ class Core {
|
|
|
|
db.attachment().setDownloaded(attachment.id, file.length());
|
|
|
|
db.attachment().setDownloaded(attachment.id, file.length());
|
|
|
|
} catch (IllegalArgumentException ex) {
|
|
|
|
} catch (IllegalArgumentException ex) {
|
|
|
|
Log.w(ex);
|
|
|
|
Log.w(ex);
|
|
|
|
|
|
|
|
db.attachment().setDownloaded(attachment.id, 0L);
|
|
|
|
|
|
|
|
db.attachment().setError(attachment.id, Log.formatThrowable(ex, false));
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
List<EntityAttachment> attachments = parts.getAttachments();
|
|
|
|
List<EntityAttachment> attachments = parts.getAttachments();
|
|
|
|