aboutsummaryrefslogtreecommitdiffstats
path: root/commands
diff options
context:
space:
mode:
Diffstat (limited to 'commands')
-rw-r--r--commands/account/compose.go4
-rw-r--r--commands/msg/forward.go4
-rw-r--r--commands/msg/reply.go6
-rw-r--r--commands/msg/unsubscribe.go1
4 files changed, 8 insertions, 7 deletions
diff --git a/commands/account/compose.go b/commands/account/compose.go
index ad48fe61..039eb923 100644
--- a/commands/account/compose.go
+++ b/commands/account/compose.go
@@ -29,7 +29,7 @@ func (Compose) Execute(aerc *widgets.Aerc, args []string) error {
return err
}
acct := aerc.SelectedAccount()
- composer := widgets.NewComposer(
+ composer := widgets.NewComposer(aerc,
aerc.Config(), acct.AccountConfig(), acct.Worker(), nil)
tab := aerc.NewTab(composer, "New email")
composer.OnHeaderChange("Subject", func(subject string) {
@@ -40,7 +40,7 @@ func (Compose) Execute(aerc *widgets.Aerc, args []string) error {
}
tab.Content.Invalidate()
})
- go composer.SetContents(strings.NewReader(body))
+ go composer.PrependContents(strings.NewReader(body))
return nil
}
diff --git a/commands/msg/forward.go b/commands/msg/forward.go
index b925a497..494072d0 100644
--- a/commands/msg/forward.go
+++ b/commands/msg/forward.go
@@ -69,7 +69,7 @@ func (forward) Execute(aerc *widgets.Aerc, args []string) error {
"To": to,
"Subject": subject,
}
- composer := widgets.NewComposer(aerc.Config(), acct.AccountConfig(),
+ composer := widgets.NewComposer(aerc, aerc.Config(), acct.AccountConfig(),
acct.Worker(), defaults)
addTab := func() {
@@ -154,7 +154,7 @@ func forwardBodyPart(store *lib.MessageStore, composer *widgets.Composer,
pipeout, pipein := io.Pipe()
scanner := bufio.NewScanner(part.Body)
- go composer.SetContents(pipeout)
+ go composer.PrependContents(pipeout)
// TODO: Let user customize the date format used here
io.WriteString(pipein, fmt.Sprintf("Forwarded message from %s on %s:\n\n",
msg.Envelope.From[0].Name,
diff --git a/commands/msg/reply.go b/commands/msg/reply.go
index 7c40e979..9ef7a3b8 100644
--- a/commands/msg/reply.go
+++ b/commands/msg/reply.go
@@ -116,8 +116,8 @@ func (reply) Execute(aerc *widgets.Aerc, args []string) error {
"In-Reply-To": msg.Envelope.MessageId,
}
- composer := widgets.NewComposer(
- aerc.Config(), acct.AccountConfig(), acct.Worker(), defaults)
+ composer := widgets.NewComposer(aerc, aerc.Config(),
+ acct.AccountConfig(), acct.Worker(), defaults)
if args[0] == "reply" {
composer.FocusTerminal()
@@ -170,7 +170,7 @@ func (reply) Execute(aerc *widgets.Aerc, args []string) error {
pipeout, pipein := io.Pipe()
scanner := bufio.NewScanner(part.Body)
- go composer.SetContents(pipeout)
+ go composer.PrependContents(pipeout)
// TODO: Let user customize the date format used here
io.WriteString(pipein, fmt.Sprintf("On %s %s wrote:\n",
msg.Envelope.Date.Format("Mon Jan 2, 2006 at 3:04 PM"),
diff --git a/commands/msg/unsubscribe.go b/commands/msg/unsubscribe.go
index f18da075..15a9411c 100644
--- a/commands/msg/unsubscribe.go
+++ b/commands/msg/unsubscribe.go
@@ -88,6 +88,7 @@ func unsubscribeMailto(aerc *widgets.Aerc, u *url.URL) error {
"Subject": u.Query().Get("subject"),
}
composer := widgets.NewComposer(
+ aerc,
aerc.Config(),
acct.AccountConfig(),
acct.Worker(),