From dfaab1f1d73e557bbdbcc428f04f701c0c09c136 Mon Sep 17 00:00:00 2001 From: Koni Marti Date: Wed, 21 Jun 2023 22:13:05 +0200 Subject: maildir: add folder-map Add the folder-map functionality to the maildir backend. If the folder-map config option is specified, the folder-map worker middleware is used. Unroll the worker.PostMessageInfoError function for a streamlined WorkerInteractor interface. Signed-off-by: Koni Marti Tested-by: Bence Ferdinandy Signed-off-by: Robin Jarry --- worker/notmuch/worker.go | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'worker/notmuch') diff --git a/worker/notmuch/worker.go b/worker/notmuch/worker.go index 70dca1e2..1e5f4c2d 100644 --- a/worker/notmuch/worker.go +++ b/worker/notmuch/worker.go @@ -387,13 +387,13 @@ func (w *worker) handleFetchMessageHeaders( m, err := w.msgFromUid(uid) if err != nil { w.w.Errorf("could not get message: %v", err) - w.w.PostMessageInfoError(msg, uid, err) + w.emitMessageInfoError(msg, uid, err) continue } err = w.emitMessageInfo(m, msg) if err != nil { w.w.Errorf("could not emit message info: %v", err) - w.w.PostMessageInfoError(msg, uid, err) + w.emitMessageInfoError(msg, uid, err) continue } } @@ -684,6 +684,18 @@ func (w *worker) emitDirectoryThreaded(parent types.WorkerMessage) error { return nil } +func (w *worker) emitMessageInfoError(msg types.WorkerMessage, uid uint32, err error) { + w.w.PostMessage(&types.MessageInfo{ + Info: &models.MessageInfo{ + Envelope: &models.Envelope{}, + Flags: models.SeenFlag, + Uid: uid, + Error: err, + }, + Message: types.RespondTo(msg), + }, nil) +} + func (w *worker) emitMessageInfo(m *Message, parent types.WorkerMessage, ) error { -- cgit