Fixed setting seen

This commit is contained in:
M66B 2018-08-26 05:28:36 +00:00
parent 2663cd1e42
commit 6ea780d524
4 changed files with 10 additions and 15 deletions

View File

@ -665,12 +665,10 @@ public class ActivityView extends ActivityBase implements FragmentManager.OnBack
db.beginTransaction();
EntityMessage message = db.message().getMessage(id);
for (EntityMessage tmessage : db.message().getMessageByThread(message.account, message.thread))
if (message.uid != null) { // Skip drafts and outbox
db.message().setMessageUiSeen(tmessage.id, true);
EntityOperation.queue(db, tmessage, EntityOperation.SEEN, true);
}
for (EntityMessage tmessage : db.message().getMessageByThread(message.account, message.thread)) {
db.message().setMessageUiSeen(tmessage.id, true);
EntityOperation.queue(db, tmessage, EntityOperation.SEEN, true);
}
db.setTransactionSuccessful();
} finally {

View File

@ -103,7 +103,8 @@ public interface DaoMessage {
@Query("SELECT message.* FROM message" +
" JOIN folder ON folder.id = message.folder" +
" WHERE message.account = :account" +
" AND message.thread = :thread")
" AND message.thread = :thread" +
" AND folder.type <> '" + EntityFolder.OUTBOX + "'")
List<EntityMessage> getMessageByThread(long account, String thread);
@Query("SELECT message.*, account.name AS accountName, folder.name as folderName, folder.type as folderType" +

View File

@ -1027,8 +1027,6 @@ public class FragmentCompose extends FragmentEx {
db.message().updateMessage(draft);
draft.write(context, pbody);
EntityOperation.queue(db, draft, EntityOperation.SEEN, true);
EntityFolder trash = db.folder().getFolderByType(draft.account, EntityFolder.TRASH);
EntityOperation.queue(db, draft, EntityOperation.MOVE, trash.id);

View File

@ -713,12 +713,10 @@ public class FragmentMessage extends FragmentEx {
db.beginTransaction();
EntityMessage message = db.message().getMessage(id);
for (EntityMessage tmessage : db.message().getMessageByThread(message.account, message.thread))
if (message.uid != null) { // Skip drafts and outbox
db.message().setMessageUiSeen(tmessage.id, !message.ui_seen);
EntityOperation.queue(db, tmessage, EntityOperation.SEEN, !tmessage.ui_seen);
}
for (EntityMessage tmessage : db.message().getMessageByThread(message.account, message.thread)) {
db.message().setMessageUiSeen(tmessage.id, !message.ui_seen);
EntityOperation.queue(db, tmessage, EntityOperation.SEEN, !tmessage.ui_seen);
}
db.setTransactionSuccessful();
} finally {