diff options
author | Robin Jarry <robin@jarry.cc> | 2023-10-09 13:52:20 +0200 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2023-10-10 11:37:56 +0200 |
commit | 598e4a5803578ab3e291f232d6aad31b4efd8ea4 (patch) | |
tree | c55e16d60e2c3eea2d6de27d1bac18db5670ec77 /commands/msg/reply.go | |
parent | 61bca76423ee87bd59084a146eca71c6bae085e1 (diff) | |
download | aerc-598e4a5803578ab3e291f232d6aad31b4efd8ea4.tar.gz |
widgets: rename package to app
This is the central point of all aerc. Having it named widgets is
confusing. Rename it to app. It will make a cleaner transition when
making the app.Aerc object available globally in the next commit.
Signed-off-by: Robin Jarry <robin@jarry.cc>
Acked-by: Moritz Poldrack <moritz@poldrack.dev>
Diffstat (limited to 'commands/msg/reply.go')
-rw-r--r-- | commands/msg/reply.go | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/commands/msg/reply.go b/commands/msg/reply.go index b2a61a80..035e6aa3 100644 --- a/commands/msg/reply.go +++ b/commands/msg/reply.go @@ -11,6 +11,7 @@ import ( "git.sr.ht/~sircmpwn/getopt" + "git.sr.ht/~rjarry/aerc/app" "git.sr.ht/~rjarry/aerc/commands/account" "git.sr.ht/~rjarry/aerc/config" "git.sr.ht/~rjarry/aerc/lib" @@ -19,7 +20,6 @@ import ( "git.sr.ht/~rjarry/aerc/lib/parse" "git.sr.ht/~rjarry/aerc/log" "git.sr.ht/~rjarry/aerc/models" - "git.sr.ht/~rjarry/aerc/widgets" "github.com/emersion/go-message/mail" ) @@ -33,11 +33,11 @@ func (reply) Aliases() []string { return []string{"reply"} } -func (reply) Complete(aerc *widgets.Aerc, args []string) []string { +func (reply) Complete(aerc *app.Aerc, args []string) []string { return nil } -func (reply) Execute(aerc *widgets.Aerc, args []string) error { +func (reply) Execute(aerc *app.Aerc, args []string) error { opts, optind, err := getopt.Getopts(args, "acqT:eE") if err != nil { return err @@ -69,7 +69,7 @@ func (reply) Execute(aerc *widgets.Aerc, args []string) error { } } - widget := aerc.SelectedTabContent().(widgets.ProvidesMessage) + widget := aerc.SelectedTabContent().(app.ProvidesMessage) acct := widget.SelectedAccount() if acct == nil { @@ -177,9 +177,9 @@ func (reply) Execute(aerc *widgets.Aerc, args []string) error { RFC822Headers: msg.RFC822Headers, } - mv, _ := aerc.SelectedTabContent().(*widgets.MessageViewer) + mv, _ := aerc.SelectedTabContent().(*app.MessageViewer) addTab := func() error { - composer, err := widgets.NewComposer(aerc, acct, + composer, err := app.NewComposer(aerc, acct, acct.AccountConfig(), acct.Worker(), editHeaders, template, h, &original, nil) if err != nil { @@ -196,7 +196,7 @@ func (reply) Execute(aerc *widgets.Aerc, args []string) error { composer.Tab = aerc.NewTab(composer, subject) - composer.OnClose(func(c *widgets.Composer) { + composer.OnClose(func(c *app.Composer) { switch { case c.Sent() && c.Archive() != "": store.Answered([]uint32{msg.Uid}, true, nil) @@ -221,8 +221,8 @@ func (reply) Execute(aerc *widgets.Aerc, args []string) error { } if crypto.IsEncrypted(msg.BodyStructure) { - provider := aerc.SelectedTabContent().(widgets.ProvidesMessage) - mv, ok := provider.(*widgets.MessageViewer) + provider := aerc.SelectedTabContent().(app.ProvidesMessage) + mv, ok := provider.(*app.MessageViewer) if !ok { return fmt.Errorf("message is encrypted. can only quote reply while message is open") } |