aboutsummaryrefslogtreecommitdiff
path: root/commands/msg/unsubscribe.go
diff options
context:
space:
mode:
Diffstat (limited to 'commands/msg/unsubscribe.go')
-rw-r--r--commands/msg/unsubscribe.go14
1 files changed, 9 insertions, 5 deletions
diff --git a/commands/msg/unsubscribe.go b/commands/msg/unsubscribe.go
index 720ff43..f18da07 100644
--- a/commands/msg/unsubscribe.go
+++ b/commands/msg/unsubscribe.go
@@ -83,15 +83,19 @@ func parseUnsubscribeMethods(header string) (methods []*url.URL) {
func unsubscribeMailto(aerc *widgets.Aerc, u *url.URL) error {
widget := aerc.SelectedTab().(widgets.ProvidesMessage)
acct := widget.SelectedAccount()
- composer := widgets.NewComposer(aerc.Config(), acct.AccountConfig(),
- acct.Worker())
- composer.Defaults(map[string]string{
+ defaults := map[string]string{
"To": u.Opaque,
"Subject": u.Query().Get("subject"),
- })
+ }
+ composer := widgets.NewComposer(
+ aerc.Config(),
+ acct.AccountConfig(),
+ acct.Worker(),
+ defaults,
+ )
composer.SetContents(strings.NewReader(u.Query().Get("body")))
tab := aerc.NewTab(composer, "unsubscribe")
- composer.OnSubjectChange(func(subject string) {
+ composer.OnHeaderChange("Subject", func(subject string) {
if subject == "" {
tab.Name = "unsubscribe"
} else {