mirror of https://github.com/M66B/FairEmail.git
Show source message on failure on cross account move
This commit is contained in:
parent
bb68824e28
commit
f912c9346f
|
@ -1025,28 +1025,39 @@ class Core {
|
|||
Log.e(ex);
|
||||
}
|
||||
} else {
|
||||
// Lookup added messages
|
||||
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 {
|
||||
Log.i(folder.name + " Fetching uid=" + found);
|
||||
JSONArray fargs = new JSONArray();
|
||||
fargs.put(found);
|
||||
onFetch(context, fargs, folder, istore, ifolder, state);
|
||||
} catch (Throwable ex) {
|
||||
Log.e(ex);
|
||||
db.beginTransaction();
|
||||
|
||||
if (found == null) {
|
||||
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();
|
||||
}
|
||||
|
||||
// Mark source read
|
||||
if (autoread)
|
||||
EntityOperation.queue(context, message, EntityOperation.SEEN, true);
|
||||
|
||||
// Delete source
|
||||
EntityOperation.queue(context, message, EntityOperation.DELETE);
|
||||
// Fetch target
|
||||
if (found != null)
|
||||
try {
|
||||
Log.i(folder.name + " Fetching uid=" + found);
|
||||
JSONArray fargs = new JSONArray();
|
||||
fargs.put(found);
|
||||
onFetch(context, fargs, folder, istore, ifolder, state);
|
||||
} catch (Throwable ex) {
|
||||
Log.e(ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue