mirror of https://github.com/M66B/FairEmail.git
Delete orphan drafts
This commit is contained in:
parent
d25b90b8eb
commit
1f4a09b4df
|
@ -644,11 +644,16 @@ class Core {
|
|||
if (TextUtils.isEmpty(message.msgid))
|
||||
throw new IllegalArgumentException("Message without msgid for " + op.name);
|
||||
|
||||
Long uid = findUid(context, ifolder, message.msgid, false);
|
||||
if (uid == null)
|
||||
throw new IllegalArgumentException("Message not found for " + op.name + " folder=" + folder.name);
|
||||
|
||||
DB db = DB.getInstance(context);
|
||||
|
||||
Long uid = findUid(context, ifolder, message.msgid, false);
|
||||
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.message().setMessageUid(message.id, message.uid);
|
||||
message.uid = uid;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue