Browse Source

Set single messages (un)read/(un)starred

main
M66B 6 years ago
parent
commit
78811ccd34
2 changed files with 8 additions and 12 deletions
  1. +1
    -4
      app/src/main/java/eu/faircode/email/ActivityView.java
  2. +7
    -8
      app/src/main/java/eu/faircode/email/AdapterMessage.java

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

@ -758,10 +758,7 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
if (!message.content)
EntityOperation.queue(db, message, EntityOperation.BODY);
for (EntityMessage tmessage : db.message().getMessageByThread(message.account, message.thread)) {
db.message().setMessageUiSeen(tmessage.id, true);
EntityOperation.queue(db, tmessage, EntityOperation.SEEN, true);
}
EntityOperation.queue(db, message, EntityOperation.SEEN, true);
db.setTransactionSuccessful();
} finally {


+ 7
- 8
app/src/main/java/eu/faircode/email/AdapterMessage.java View File

@ -358,14 +358,13 @@ public class AdapterMessage extends PagedListAdapter<TupleMessageEx, AdapterMess
db.beginTransaction();
EntityMessage message = db.message().getMessage(id);
for (EntityMessage tmessage : db.message().getMessageByThread(message.account, message.thread))
if (action == action_flag) {
db.message().setMessageUiFlagged(tmessage.id, !message.ui_flagged);
EntityOperation.queue(db, tmessage, EntityOperation.FLAG, !tmessage.ui_flagged);
} else if (action == action_seen) {
db.message().setMessageUiSeen(tmessage.id, !message.ui_seen);
EntityOperation.queue(db, tmessage, EntityOperation.SEEN, !tmessage.ui_seen);
}
if (action == action_flag) {
db.message().setMessageUiFlagged(message.id, !message.ui_flagged);
EntityOperation.queue(db, message, EntityOperation.FLAG, !message.ui_flagged);
} else if (action == action_seen) {
db.message().setMessageUiSeen(message.id, !message.ui_seen);
EntityOperation.queue(db, message, EntityOperation.SEEN, !message.ui_seen);
}
db.setTransactionSuccessful();
} finally {


Loading…
Cancel
Save