Browse Source

Handle duplicate CID

main
M66B 6 years ago
parent
commit
1647e3e652
1 changed files with 7 additions and 2 deletions
  1. +7
    -2
      app/src/main/java/eu/faircode/email/ServiceSynchronize.java

+ 7
- 2
app/src/main/java/eu/faircode/email/ServiceSynchronize.java View File

@ -1711,8 +1711,13 @@ public class ServiceSynchronize extends LifecycleService {
int sequence = 1; int sequence = 1;
for (EntityAttachment attachment : helper.getAttachments()) { for (EntityAttachment attachment : helper.getAttachments()) {
Log.i(Helper.TAG, folder.name + " attachment" +
" seq=" + sequence + " name=" + attachment.name + " type=" + attachment.type);
Log.i(Helper.TAG, folder.name + " attachment seq=" + sequence +
" name=" + attachment.name + " type=" + attachment.type + " cid=" + attachment.cid);
if (!TextUtils.isEmpty(attachment.cid) &&
db.attachment().getAttachment(message.id, attachment.cid) != null) {
Log.i(Helper.TAG, "Skipping duplicated CID");
continue;
}
attachment.message = message.id; attachment.message = message.id;
attachment.sequence = sequence++; attachment.sequence = sequence++;
attachment.id = db.attachment().insertAttachment(attachment); attachment.id = db.attachment().insertAttachment(attachment);


Loading…
Cancel
Save