Browse Source

Mark only synchronized messages seen

Skip drafts and outbox
main
M66B 6 years ago
parent
commit
92fc1349f0
2 changed files with 7 additions and 6 deletions
  1. +2
    -2
      app/src/main/java/eu/faircode/email/ActivityView.java
  2. +5
    -4
      app/src/main/java/eu/faircode/email/FragmentMessage.java

+ 2
- 2
app/src/main/java/eu/faircode/email/ActivityView.java View File

@ -521,8 +521,8 @@ public class ActivityView extends ActivityBase implements FragmentManager.OnBack
EntityMessage message = db.message().getMessage(id); EntityMessage message = db.message().getMessage(id);
EntityFolder folder = db.folder().getFolder(message.folder); EntityFolder folder = db.folder().getFolder(message.folder);
if (!EntityFolder.OUTBOX.equals(folder.type))
for (EntityMessage tmessage : db.message().getMessageByThread(message.account, message.thread)) {
for (EntityMessage tmessage : db.message().getMessageByThread(message.account, message.thread))
if (message.uid != null) { // Skip drafts and outbox
db.message().setMessageUiSeen(tmessage.id, true); db.message().setMessageUiSeen(tmessage.id, true);
EntityOperation.queue(db, tmessage, EntityOperation.SEEN, true); EntityOperation.queue(db, tmessage, EntityOperation.SEEN, true);


+ 5
- 4
app/src/main/java/eu/faircode/email/FragmentMessage.java View File

@ -414,11 +414,12 @@ public class FragmentMessage extends FragmentEx {
db.beginTransaction(); db.beginTransaction();
EntityMessage message = db.message().getMessage(id); EntityMessage message = db.message().getMessage(id);
for (EntityMessage tmessage : db.message().getMessageByThread(message.account, message.thread)) {
db.message().setMessageUiSeen(tmessage.id, !message.ui_seen);
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);
}
EntityOperation.queue(db, tmessage, EntityOperation.SEEN, !tmessage.ui_seen);
}
db.setTransactionSuccessful(); db.setTransactionSuccessful();
} finally { } finally {


Loading…
Cancel
Save