diff options
author | Koni Marti <koni.marti@gmail.com> | 2023-06-21 22:13:05 +0200 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2023-06-22 10:55:25 +0200 |
commit | dfaab1f1d73e557bbdbcc428f04f701c0c09c136 (patch) | |
tree | 84266f8b5930c29e1d6b92f29ca67aabab4aa154 /worker/notmuch | |
parent | 626d118a31d6cb36900e67b93d535434aea75cb3 (diff) | |
download | aerc-dfaab1f1d73e557bbdbcc428f04f701c0c09c136.tar.gz |
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 <koni.marti@gmail.com>
Tested-by: Bence Ferdinandy <bence@ferdinandy.com>
Signed-off-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'worker/notmuch')
-rw-r--r-- | worker/notmuch/worker.go | 16 |
1 files changed, 14 insertions, 2 deletions
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 { |