Set msgid/thread, reset error for found messages

This commit is contained in:
M66B 2018-10-18 08:21:42 +00:00
parent bc46be4ac6
commit dfadbc10ec
1 changed files with 9 additions and 5 deletions

View File

@ -1708,15 +1708,19 @@ public class ServiceSynchronize extends LifecycleService {
for (EntityMessage dup : db.message().getMessageByMsgId(folder.account, msgid, reference)) { for (EntityMessage dup : db.message().getMessageByMsgId(folder.account, msgid, reference)) {
EntityFolder dfolder = db.folder().getFolder(dup.folder); EntityFolder dfolder = db.folder().getFolder(dup.folder);
boolean outbox = EntityFolder.OUTBOX.equals(dfolder.type); boolean outbox = EntityFolder.OUTBOX.equals(dfolder.type);
Log.i(Helper.TAG, folder.name + " found as id=" + dup.id + Log.i(Helper.TAG, folder.name + " found as id=" + dup.id + "/" + dup.uid +
" folder=" + dfolder.type + ":" + dup.folder + "/" + folder.type + ":" + folder.id); " folder=" + dfolder.type + ":" + dup.folder + "/" + folder.type + ":" + folder.id +
" msgid=" + dup.msgid + " thread=" + dup.thread);
if (dup.folder.equals(folder.id) || outbox) { if (dup.folder.equals(folder.id) || outbox) {
Log.i(Helper.TAG, folder.name + " found as id=" + dup.id + " uid=" + dup.uid + " msgid=" + msgid); String thread = helper.getThreadId(uid);
Log.i(Helper.TAG, folder.name + " found as id=" + dup.id + "/" + uid +
" msgid=" + msgid + " thread=" + thread);
dup.folder = folder.id; dup.folder = folder.id;
dup.uid = uid; dup.uid = uid;
if (TextUtils.isEmpty(dup.thread)) // outbox: only now the uid is known dup.msgid = msgid;
dup.thread = helper.getThreadId(uid); dup.thread = thread;
dup.error = null;
db.message().updateMessage(dup); db.message().updateMessage(dup);
message = dup; message = dup;
} }