Delete orphan drafts

pull/198/head
M66B 4 years ago
parent d25b90b8eb
commit 1f4a09b4df

@ -644,11 +644,16 @@ class Core {
if (TextUtils.isEmpty(message.msgid))
throw new IllegalArgumentException("Message without msgid for " + op.name);
DB db = DB.getInstance(context);
Long uid = findUid(context, ifolder, message.msgid, false);
if (uid == null)
if (uid == null) {
if (EntityFolder.DRAFTS.equals(folder.type) &&
EntityOperation.MOVE.equals(op.name))
db.message().deleteMessage(message.id);
throw new IllegalArgumentException("Message not found for " + op.name + " folder=" + folder.name);
}
DB db = DB.getInstance(context);
db.message().setMessageUid(message.id, message.uid);
message.uid = uid;
}

Loading…
Cancel
Save