db195bebf0
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>
31 lines
517 B
Go
31 lines
517 B
Go
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
|
|
}
|