diff options
author | Koni Marti <koni.marti@gmail.com> | 2022-09-21 00:27:58 +0200 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2022-09-25 11:54:23 +0200 |
commit | e5b0725824ac9ccf218732238e4b3b525fa6ad46 (patch) | |
tree | 54ae2d8ea02616c32a74a3d4fcfb3dce50d1c376 /lib/messageview.go | |
parent | 41822a6123d5b6779be436d738bf26747de87b0a (diff) | |
download | aerc-e5b0725824ac9ccf218732238e4b3b525fa6ad46.tar.gz |
charset: handle unknown charsets more user-friendly
Do not throw an error when the charset is unknown; the message entity
can still be read, but log the error instead.
Reported-by: falsifian
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 | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/messageview.go b/lib/messageview.go index 6ad86c9c..ff754a43 100644 --- a/lib/messageview.go +++ b/lib/messageview.go @@ -5,7 +5,6 @@ import ( "io" "github.com/ProtonMail/go-crypto/openpgp" - "github.com/emersion/go-message" _ "github.com/emersion/go-message/charset" "git.sr.ht/~rjarry/aerc/lib/crypto" @@ -81,7 +80,7 @@ func NewMessageStoreView(messageInfo *models.MessageInfo, cb(nil, err) return } - decrypted, err := message.Read(bytes.NewBuffer(msv.message)) + decrypted, err := lib.ReadMessage(bytes.NewBuffer(msv.message)) if err != nil { cb(nil, err) return @@ -124,7 +123,7 @@ func (msv *MessageStoreView) FetchBodyPart(part []int, cb func(io.Reader)) { } buf := bytes.NewBuffer(msv.message) - msg, err := message.Read(buf) + msg, err := lib.ReadMessage(buf) if err != nil { panic(err) } |