aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Jarry <robin@jarry.cc>2024-02-07 16:32:09 +0100
committerRobin Jarry <robin@jarry.cc>2024-02-11 22:03:56 +0100
commit7c7a7ba8027e3e12ba88dc54b7f4d882afd2b30a (patch)
treee1370e24a962568fa1e0483c4c8cd1b35d8d4ee2
parentd4102e7af635f3e46163f834a4774778d8be9603 (diff)
downloadaerc-7c7a7ba8027e3e12ba88dc54b7f4d882afd2b30a.tar.gz
view: only set seen flag if not present
No need to do anything if the message was already seen once. Signed-off-by: Robin Jarry <robin@jarry.cc> Reviewed-by: Bence Ferdinandy <bence@ferdinandy.com>
-rw-r--r--lib/messageview.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/messageview.go b/lib/messageview.go
index 6c478c6e..6e1ce858 100644
--- a/lib/messageview.go
+++ b/lib/messageview.go
@@ -73,7 +73,8 @@ func NewMessageStoreView(messageInfo *models.MessageInfo, setSeen bool,
innerCb func(MessageView, error),
) {
cb := func(msv MessageView, err error) {
- if msv != nil && setSeen && err == nil {
+ if msv != nil && setSeen && err == nil &&
+ !messageInfo.Flags.Has(models.SeenFlag) {
store.Flag([]uint32{messageInfo.Uid}, models.SeenFlag, true, nil)
}
innerCb(msv, err)