|
|
|
@ -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);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|