From db195bebf061d793ff34ba209059fe3f43e189e2 Mon Sep 17 00:00:00 2001 From: Tim Culverhouse Date: Fri, 29 Jul 2022 13:30:02 -0500 Subject: commands: add check-mail command Add :check-mail command for ad-hoc checking of mail. Reset timer for automatic checking if it is enabled. Suggested-by: staceee Signed-off-by: Tim Culverhouse Acked-by: Robin Jarry --- commands/account/check-mail.go | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 commands/account/check-mail.go (limited to 'commands/account') diff --git a/commands/account/check-mail.go b/commands/account/check-mail.go new file mode 100644 index 00000000..eb57c0c0 --- /dev/null +++ b/commands/account/check-mail.go @@ -0,0 +1,31 @@ +package account + +import ( + "errors" + + "git.sr.ht/~rjarry/aerc/widgets" +) + +type CheckMail struct{} + +func init() { + register(CheckMail{}) +} + +func (CheckMail) Aliases() []string { + return []string{"check-mail"} +} + +func (CheckMail) Complete(aerc *widgets.Aerc, args []string) []string { + return nil +} + +func (CheckMail) Execute(aerc *widgets.Aerc, args []string) error { + acct := aerc.SelectedAccount() + if acct == nil { + return errors.New("No account selected") + } + acct.CheckMailReset() + acct.CheckMail() + return nil +} -- cgit