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,28 +1025,39 @@ class Core {
Log.e(ex); Log.e(ex);
} }
} else { } else {
// Lookup added messages
Long found = findUid(context, ifolder, message.msgid, false); Long found = findUid(context, ifolder, message.msgid, false);
if (found == null) {
String msg = "Added message not found msgid=" + message.msgid;
Log.e(msg);
throw new IllegalArgumentException(msg);
}
try { try {
Log.i(folder.name + " Fetching uid=" + found); db.beginTransaction();
JSONArray fargs = new JSONArray();
fargs.put(found); if (found == null) {
onFetch(context, fargs, folder, istore, ifolder, state); db.message().setMessageError(message.id, "Message not found in target folder");
} catch (Throwable ex) { db.message().setMessageUiHide(message.id, false);
Log.e(ex); } 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();
} }
// Mark source read // Fetch target
if (autoread) if (found != null)
EntityOperation.queue(context, message, EntityOperation.SEEN, true); try {
Log.i(folder.name + " Fetching uid=" + found);
// Delete source JSONArray fargs = new JSONArray();
EntityOperation.queue(context, message, EntityOperation.DELETE); fargs.put(found);
onFetch(context, fargs, folder, istore, ifolder, state);
} catch (Throwable ex) {
Log.e(ex);
}
} }
} }