Fixed setting seen

pull/72/head
M66B 6 years ago
parent 2663cd1e42
commit 6ea780d524

@ -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 {

@ -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" +

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

@ -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 {

Loading…
Cancel
Save