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 <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
This commit is contained in:
parent
44651b43b3
commit
db195bebf0
4 changed files with 56 additions and 2 deletions
commands/account
31
commands/account/check-mail.go
Normal file
31
commands/account/check-mail.go
Normal file
|
@ -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
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue