view: add peek flag and propagate

Add a peek flag -p to the view commands to open the message viewer
without setting the "seen" flag. If the flag is set, it would ignore the
"auto-mark-read" config.

The SetSeen flag will be propagated in case the message viewer moves on
to other messages, i.e. with the delete or archive commands.

Signed-off-by: Koni Marti <koni.marti@gmail.com>
Acked-by: Robin Jarry <robin@jarry.cc>
This commit is contained in:
Koni Marti 2022-10-03 23:56:07 +02:00 committed by Robin Jarry
parent e4d418eed1
commit d3b62dd3b0
6 changed files with 32 additions and 8 deletions

View file

@ -120,7 +120,7 @@ func (Archive) Execute(aerc *widgets.Aerc, args []string) error {
acct.Messages().Invalidate()
return
}
lib.NewMessageStoreView(next, acct.UiConfig().AutoMarkRead,
lib.NewMessageStoreView(next, mv.MessageView().SeenFlagSet(),
store, aerc.Crypto, aerc.DecryptKeys,
func(view lib.MessageView, err error) {
if err != nil {

View file

@ -63,7 +63,7 @@ func (Delete) Execute(aerc *widgets.Aerc, args []string) error {
acct.Messages().Invalidate()
return
}
lib.NewMessageStoreView(next, acct.UiConfig().AutoMarkRead,
lib.NewMessageStoreView(next, mv.MessageView().SeenFlagSet(),
store, aerc.Crypto, aerc.DecryptKeys,
func(view lib.MessageView, err error) {
if err != nil {