|
@ -970,8 +970,8 @@ public class ServiceSynchronize extends LifecycleService { |
|
|
message.ui_seen = true; |
|
|
message.ui_seen = true; |
|
|
db.message().updateMessage(message); |
|
|
db.message().updateMessage(message); |
|
|
|
|
|
|
|
|
if (sent != null) |
|
|
|
|
|
EntityOperation.queue(db, message, EntityOperation.ADD); // Could already exist |
|
|
|
|
|
|
|
|
//if (sent != null) |
|
|
|
|
|
// EntityOperation.queue(db, message, EntityOperation.ADD); // Could already exist |
|
|
|
|
|
|
|
|
db.setTransactionSuccessful(); |
|
|
db.setTransactionSuccessful(); |
|
|
} finally { |
|
|
} finally { |
|
@ -1193,14 +1193,15 @@ public class ServiceSynchronize extends LifecycleService { |
|
|
// Find message by Message-ID (slow, headers required) |
|
|
// Find message by Message-ID (slow, headers required) |
|
|
// - messages in inbox have same id as message sent to self |
|
|
// - messages in inbox have same id as message sent to self |
|
|
// - messages in archive have same id as original |
|
|
// - messages in archive have same id as original |
|
|
if (message == null && |
|
|
|
|
|
!EntityFolder.SENT.equals(folder.type) && |
|
|
|
|
|
!EntityFolder.ARCHIVE.equals(folder.type)) { |
|
|
|
|
|
|
|
|
if (message == null) { |
|
|
// Will fetch headers within database transaction |
|
|
// Will fetch headers within database transaction |
|
|
String msgid = imessage.getMessageID(); |
|
|
String msgid = imessage.getMessageID(); |
|
|
message = db.message().getMessageByMsgId(msgid); |
|
|
message = db.message().getMessageByMsgId(msgid); |
|
|
if (message != null) { |
|
|
if (message != null) { |
|
|
if (message.folder == folder.id || EntityFolder.OUTBOX.equals(folder.type)) { |
|
|
|
|
|
|
|
|
EntityFolder mfolder = db.folder().getFolder(message.folder); |
|
|
|
|
|
Log.i(Helper.TAG, folder.name + " found as id=" + message.id + |
|
|
|
|
|
" folder=" + mfolder.type + ":" + message.folder + "/" + folder.type + ":" + folder.id); |
|
|
|
|
|
if (message.folder.equals(folder.id) || EntityFolder.OUTBOX.equals(mfolder.type)) { |
|
|
Log.i(Helper.TAG, folder.name + " found as id=" + message.id + " uid=" + message.uid + " msgid=" + msgid); |
|
|
Log.i(Helper.TAG, folder.name + " found as id=" + message.id + " uid=" + message.uid + " msgid=" + msgid); |
|
|
message.folder = folder.id; |
|
|
message.folder = folder.id; |
|
|
message.uid = uid; |
|
|
message.uid = uid; |
|
@ -1243,8 +1244,7 @@ public class ServiceSynchronize extends LifecycleService { |
|
|
message.folder = folder.id; |
|
|
message.folder = folder.id; |
|
|
message.uid = uid; |
|
|
message.uid = uid; |
|
|
|
|
|
|
|
|
if (!EntityFolder.SENT.equals(folder.type) && |
|
|
|
|
|
!EntityFolder.ARCHIVE.equals(folder.type)) { |
|
|
|
|
|
|
|
|
if (!EntityFolder.ARCHIVE.equals(folder.type)) { |
|
|
message.msgid = helper.getMessageID(); |
|
|
message.msgid = helper.getMessageID(); |
|
|
if (TextUtils.isEmpty(message.msgid)) |
|
|
if (TextUtils.isEmpty(message.msgid)) |
|
|
Log.w(Helper.TAG, "No Message-ID id=" + message.id + " uid=" + message.uid); |
|
|
Log.w(Helper.TAG, "No Message-ID id=" + message.id + " uid=" + message.uid); |
|
|