aboutsummaryrefslogtreecommitdiff
path: root/worker/imap
diff options
context:
space:
mode:
Diffstat (limited to 'worker/imap')
-rw-r--r--worker/imap/worker.go10
1 files changed, 8 insertions, 2 deletions
diff --git a/worker/imap/worker.go b/worker/imap/worker.go
index de86994..b1ef9c9 100644
--- a/worker/imap/worker.go
+++ b/worker/imap/worker.go
@@ -13,9 +13,15 @@ import (
"git.sr.ht/~sircmpwn/aerc/lib"
"git.sr.ht/~sircmpwn/aerc/models"
+ "git.sr.ht/~sircmpwn/aerc/worker/handlers"
"git.sr.ht/~sircmpwn/aerc/worker/types"
)
+func init() {
+ handlers.RegisterWorkerFactory("imap", NewIMAPWorker)
+ handlers.RegisterWorkerFactory("imaps", NewIMAPWorker)
+}
+
var errUnsupported = fmt.Errorf("unsupported command")
type imapClient struct {
@@ -43,12 +49,12 @@ type IMAPWorker struct {
seqMap []uint32
}
-func NewIMAPWorker(worker *types.Worker) *IMAPWorker {
+func NewIMAPWorker(worker *types.Worker) (types.Backend, error) {
return &IMAPWorker{
idleDone: make(chan error),
updates: make(chan client.Update, 50),
worker: worker,
- }
+ }, nil
}
func (w *IMAPWorker) handleMessage(msg types.WorkerMessage) error {