~rjarry/aerc

7c7a7ba8027e3e12ba88dc54b7f4d882afd2b30a — Robin Jarry 19 days ago d4102e7
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>

1 files changed, 2 insertions(+), 1 deletions(-)

M lib/messageview.go
M lib/messageview.go => lib/messageview.go +2 -1
@@ 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)