aboutsummaryrefslogtreecommitdiffstats
path: root/commands/msg
diff options
context:
space:
mode:
authorKoni Marti <koni.marti@gmail.com>2022-02-18 00:34:24 +0100
committerRobin Jarry <robin@jarry.cc>2022-02-19 15:46:23 +0100
commit287df9defb81745b12b531db91ff6363cb58edea (patch)
treed6a75dc53edf9ef95e44a73c7b2e218decfe327e /commands/msg
parent11a4d5b71c12ff358916f1e0d0aed2cc26f9ea98 (diff)
downloadaerc-287df9defb81745b12b531db91ff6363cb58edea.tar.gz
unsubscribe: parse internationalized headers
Fix the parsing of internationalized headers (RFC 6532). Enable unsubscribe to work with regular and encoded headers. Signed-off-by: Koni Marti <koni.marti@gmail.com>
Diffstat (limited to 'commands/msg')
-rw-r--r--commands/msg/unsubscribe.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/commands/msg/unsubscribe.go b/commands/msg/unsubscribe.go
index a489ec58..3a69ff98 100644
--- a/commands/msg/unsubscribe.go
+++ b/commands/msg/unsubscribe.go
@@ -44,7 +44,11 @@ func (Unsubscribe) Execute(aerc *widgets.Aerc, args []string) error {
if !headers.Has("list-unsubscribe") {
return errors.New("No List-Unsubscribe header found")
}
- methods := parseUnsubscribeMethods(headers.Get("list-unsubscribe"))
+ text, err := headers.Text("list-unsubscribe")
+ if err != nil {
+ return err
+ }
+ methods := parseUnsubscribeMethods(text)
aerc.Logger().Printf("found %d unsubscribe methods", len(methods))
for _, method := range methods {
aerc.Logger().Printf("trying to unsubscribe using %v", method)