diff options
author | Koni Marti <koni.marti@gmail.com> | 2022-10-03 23:56:06 +0200 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2022-10-04 09:43:58 +0200 |
commit | e4d418eed15858d6dcae70e73b8a6c3e4439b5bc (patch) | |
tree | 58f1bc0b216965415074fa77c6503594771ea080 /lib/messageview.go | |
parent | 4c371170c57d39399a924bd4d27d67226a9a7f39 (diff) | |
download | aerc-e4d418eed15858d6dcae70e73b8a6c3e4439b5bc.tar.gz |
viewer: option to not mark message as seen
Add option to open a message in the message viewer without setting the
seen flag. Enables the message viewer to be used as a preview pane
without changing the message flags unintentionally. Before, the message
viewer would set the seen flag by default. The IMAP backend will now
always fetch the message body with the peek option enabled (same as we
fetch the headers).
An "auto-mark-read" option is added to the ui config which is set to
true by default. If set the false, the seen flag is not set by the
message viewer.
Co-authored-by: "James Cook" <falsifian@falsifian.org>
Signed-off-by: Koni Marti <koni.marti@gmail.com>
Acked-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'lib/messageview.go')
-rw-r--r-- | lib/messageview.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/messageview.go b/lib/messageview.go index ff754a43..d774f4f3 100644 --- a/lib/messageview.go +++ b/lib/messageview.go @@ -58,7 +58,7 @@ type MessageStoreView struct { bodyStructure *models.BodyStructure } -func NewMessageStoreView(messageInfo *models.MessageInfo, +func NewMessageStoreView(messageInfo *models.MessageInfo, setSeen bool, store *MessageStore, pgp crypto.Provider, decryptKeys openpgp.PromptFunction, cb func(MessageView, error), ) { @@ -97,7 +97,9 @@ func NewMessageStoreView(messageInfo *models.MessageInfo, } else { cb(msv, nil) } - store.Flag([]uint32{messageInfo.Uid}, models.SeenFlag, true, nil) + if setSeen { + store.Flag([]uint32{messageInfo.Uid}, models.SeenFlag, true, nil) + } } func (msv *MessageStoreView) MessageInfo() *models.MessageInfo { |