From 2fbb7ce4cbf67538fb7e3416ba0820a22607d452 Mon Sep 17 00:00:00 2001 From: Tim Culverhouse Date: Sun, 16 Apr 2023 09:53:39 -0500 Subject: msgstore: create from types.Directory message Create msgstores when a types.Directory message is received. This removes a quirk from the IMAP worker that msgstores are created on the first DirectoryInfo, and updated on the second. This path requires three messages in order to get an updated message store. By creating from types.Directory, we ensure that any subsequent DirectoryInfo can be routed to a msgstore. Remove the field DirInfo from the msgstore initializer, it isn't needed at initialization and isn't available with this refactor. Signed-off-by: Tim Culverhouse Acked-by: Robin Jarry --- worker/notmuch/worker.go | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'worker/notmuch/worker.go') diff --git a/worker/notmuch/worker.go b/worker/notmuch/worker.go index 81f38d1c..687d3f67 100644 --- a/worker/notmuch/worker.go +++ b/worker/notmuch/worker.go @@ -318,6 +318,13 @@ func (w *worker) handleOpenDirectory(msg *types.OpenDirectory) error { if !ok { q = msg.Directory isDynamicFolder = true + w.w.PostMessage(&types.Directory{ + Message: types.RespondTo(msg), + Dir: &models.Directory{ + Name: q, + Attributes: []string{}, + }, + }, nil) } } w.query = q -- cgit