summary refs log tree commit diff stats
path: root/commands
diff options
context:
space:
mode:
Diffstat (limited to 'commands')
-rw-r--r--commands/account/view.go8
-rw-r--r--commands/msg/delete.go7
-rw-r--r--commands/msgview/next.go8
3 files changed, 17 insertions, 6 deletions
diff --git a/commands/account/view.go b/commands/account/view.go
index aab9052..d1b90ce 100644
--- a/commands/account/view.go
+++ b/commands/account/view.go
@@ -3,6 +3,7 @@ package account
 import (
 	"errors"
 
+	"git.sr.ht/~sircmpwn/aerc/lib"
 	"git.sr.ht/~sircmpwn/aerc/widgets"
 )
 
@@ -37,7 +38,10 @@ func (ViewMessage) Execute(aerc *widgets.Aerc, args []string) error {
 	if deleted {
 		return nil
 	}
-	viewer := widgets.NewMessageViewer(acct, aerc.Config(), store, msg)
-	aerc.NewTab(viewer, msg.Envelope.Subject)
+	lib.NewMessageStoreView(msg, store, aerc.DecryptKeys,
+		func(view lib.MessageView) {
+			viewer := widgets.NewMessageViewer(acct, aerc.Config(), view)
+			aerc.NewTab(viewer, msg.Envelope.Subject)
+		})
 	return nil
 }
diff --git a/commands/msg/delete.go b/commands/msg/delete.go
index 3f91a46..fb0d1f8 100644
--- a/commands/msg/delete.go
+++ b/commands/msg/delete.go
@@ -68,8 +68,11 @@ func (Delete) Execute(aerc *widgets.Aerc, args []string) error {
 				acct.Messages().Scroll()
 				return nil
 			}
-			nextMv := widgets.NewMessageViewer(acct, aerc.Config(), store, next)
-			aerc.ReplaceTab(mv, nextMv, next.Envelope.Subject)
+			lib.NewMessageStoreView(next, store, aerc.DecryptKeys,
+				func(view lib.MessageView) {
+					nextMv := widgets.NewMessageViewer(acct, aerc.Config(), view)
+					aerc.ReplaceTab(mv, nextMv, next.Envelope.Subject)
+				})
 		}
 	}
 	acct.Messages().Scroll()
diff --git a/commands/msgview/next.go b/commands/msgview/next.go
index 4dc504c..c218ad5 100644
--- a/commands/msgview/next.go
+++ b/commands/msgview/next.go
@@ -2,6 +2,7 @@ package msgview
 
 import (
 	"git.sr.ht/~sircmpwn/aerc/commands/account"
+	"git.sr.ht/~sircmpwn/aerc/lib"
 	"git.sr.ht/~sircmpwn/aerc/widgets"
 )
 
@@ -36,7 +37,10 @@ func (NextPrevMsg) Execute(aerc *widgets.Aerc, args []string) error {
 		aerc.RemoveTab(mv)
 		return nil
 	}
-	nextMv := widgets.NewMessageViewer(acct, aerc.Config(), store, nextMsg)
-	aerc.ReplaceTab(mv, nextMv, nextMsg.Envelope.Subject)
+	lib.NewMessageStoreView(nextMsg, store, aerc.DecryptKeys,
+		func(view lib.MessageView) {
+			nextMv := widgets.NewMessageViewer(acct, aerc.Config(), view)
+			aerc.ReplaceTab(mv, nextMv, nextMsg.Envelope.Subject)
+		})
 	return nil
 }