1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2025-01-01 12:44:42 +00:00

Show source message on failure on cross account move

This commit is contained in:
M66B 2021-03-11 08:05:41 +01:00
parent bb68824e28
commit f912c9346f

View file

@ -1025,13 +1025,31 @@ class Core {
Log.e(ex);
}
} else {
// Lookup added messages
Long found = findUid(context, ifolder, message.msgid, false);
try {
db.beginTransaction();
if (found == null) {
String msg = "Added message not found msgid=" + message.msgid;
Log.e(msg);
throw new IllegalArgumentException(msg);
db.message().setMessageError(message.id, "Message not found in target folder");
db.message().setMessageUiHide(message.id, false);
} else {
// Mark source read
if (autoread)
EntityOperation.queue(context, message, EntityOperation.SEEN, true);
// Delete source
EntityOperation.queue(context, message, EntityOperation.DELETE);
}
db.setTransactionSuccessful();
} finally {
db.endTransaction();
}
// Fetch target
if (found != null)
try {
Log.i(folder.name + " Fetching uid=" + found);
JSONArray fargs = new JSONArray();
@ -1040,13 +1058,6 @@ class Core {
} catch (Throwable ex) {
Log.e(ex);
}
// Mark source read
if (autoread)
EntityOperation.queue(context, message, EntityOperation.SEEN, true);
// Delete source
EntityOperation.queue(context, message, EntityOperation.DELETE);
}
}