From 05fa79eb8efa02e39962c08231ec0e40cafe0020 Mon Sep 17 00:00:00 2001 From: Ben Fiedler Date: Fri, 24 Apr 2020 22:31:39 +0200 Subject: store.FetchFull: Change callback type to expose entire message This is a prerequisite for allowing the FetchFull message to return both the message content and the message headers. --- lib/messageview.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/messageview.go') diff --git a/lib/messageview.go b/lib/messageview.go index be3b90ff..3bf133aa 100644 --- a/lib/messageview.go +++ b/lib/messageview.go @@ -12,6 +12,7 @@ import ( "git.sr.ht/~sircmpwn/aerc/models" "git.sr.ht/~sircmpwn/aerc/worker/lib" + "git.sr.ht/~sircmpwn/aerc/worker/types" ) // This is an abstraction for viewing a message with semi-transparent PGP @@ -65,7 +66,8 @@ func NewMessageStoreView(messageInfo *models.MessageInfo, nil, nil, messageInfo.BodyStructure} if usePGP(messageInfo.BodyStructure) { - store.FetchFull([]uint32{messageInfo.Uid}, func(reader io.Reader) { + store.FetchFull([]uint32{messageInfo.Uid}, func(fm *types.FullMessage) { + reader := fm.Content.Reader pgpReader, err := pgpmail.Read(reader, Keyring, decryptKeys, nil) if err != nil { panic(err) -- cgit