From dfadbc10ecece21134b14e381895aaa498e348b6 Mon Sep 17 00:00:00 2001 From: M66B Date: Thu, 18 Oct 2018 08:21:42 +0000 Subject: [PATCH] Set msgid/thread, reset error for found messages --- .../java/eu/faircode/email/ServiceSynchronize.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/ServiceSynchronize.java b/app/src/main/java/eu/faircode/email/ServiceSynchronize.java index 6d77aaab..d0caa957 100644 --- a/app/src/main/java/eu/faircode/email/ServiceSynchronize.java +++ b/app/src/main/java/eu/faircode/email/ServiceSynchronize.java @@ -1708,15 +1708,19 @@ public class ServiceSynchronize extends LifecycleService { for (EntityMessage dup : db.message().getMessageByMsgId(folder.account, msgid, reference)) { EntityFolder dfolder = db.folder().getFolder(dup.folder); boolean outbox = EntityFolder.OUTBOX.equals(dfolder.type); - Log.i(Helper.TAG, folder.name + " found as id=" + dup.id + - " folder=" + dfolder.type + ":" + dup.folder + "/" + folder.type + ":" + folder.id); + Log.i(Helper.TAG, folder.name + " found as id=" + dup.id + "/" + dup.uid + + " folder=" + dfolder.type + ":" + dup.folder + "/" + folder.type + ":" + folder.id + + " msgid=" + dup.msgid + " thread=" + dup.thread); 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.uid = uid; - if (TextUtils.isEmpty(dup.thread)) // outbox: only now the uid is known - dup.thread = helper.getThreadId(uid); + dup.msgid = msgid; + dup.thread = thread; + dup.error = null; db.message().updateMessage(dup); message = dup; }