1
0
Fork 0
mirror of https://git.sr.ht/~rjarry/aerc synced 2026-04-08 09:00:58 +02:00
aerc/worker/imap/create.go
Robin Jarry 6dc701a2a0 imap: centralize error and response handling in Run loop
Refactor all IMAP message handlers to return errors instead of posting
Done or Error messages directly. The main Run loop now handles all
response posting in a single location, reducing code duplication and
ensuring consistent error handling across all operations.

Introduce two sentinel errors: ErrUnsupported for operations not
implemented by a backend and ErrNoop for operations that completed
without effect and should not trigger a Done message. Use
context.Canceled for cancelled operations.

Move connection timeout management from handleMessage to the
stopIdler/startIdler functions where it is more logically placed. Set
timeout before stopping IDLE when real commands execute, and clear it
when starting IDLE to allow indefinite waiting.

Signed-off-by: Robin Jarry <robin@jarry.cc>
Reviewed-by: Simon Martin <simon@nasilyan.com>
2026-02-09 14:46:27 +01:00

12 lines
252 B
Go

package imap
import (
"git.sr.ht/~rjarry/aerc/worker/types"
)
func (imapw *IMAPWorker) handleCreateDirectory(msg *types.CreateDirectory) error {
if err := imapw.client.Create(msg.Directory); err != nil && !msg.Quiet {
return err
}
return nil
}