mirror of
https://github.com/M66B/FairEmail.git
synced 2025-12-29 00:51:44 +01:00
Small improvement
This commit is contained in:
@@ -119,10 +119,13 @@ public class EntityAttachment {
|
||||
|
||||
static void copy(Context context, long oldid, long newid) {
|
||||
DB db = DB.getInstance(context);
|
||||
|
||||
List<EntityAttachment> attachments = db.attachment().getAttachments(oldid);
|
||||
for (EntityAttachment attachment : attachments) {
|
||||
File source = attachment.getFile(context);
|
||||
|
||||
long aid = attachment.id;
|
||||
|
||||
attachment.id = null;
|
||||
attachment.message = newid;
|
||||
attachment.progress = null;
|
||||
@@ -134,6 +137,7 @@ public class EntityAttachment {
|
||||
Helper.copy(source, target);
|
||||
} catch (IOException ex) {
|
||||
Log.e(ex);
|
||||
db.attachment().setError(aid, Helper.formatThrowable(ex, false));
|
||||
db.attachment().setError(attachment.id, Helper.formatThrowable(ex, false));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user