notmuch: emit a DirectoryInfo message upon check-mail completion

Send a DirectoryInfo message when check-mail completes to re-fetch
directory content in case it changed.

Signed-off-by: Julian Pidancet <julian.pidancet@oracle.com>
Acked-by: Robin Jarry <robin@jarry.cc>
Acked-by: Tim Culverhouse <tim@timculverhouse.com>
This commit is contained in:
Julian Pidancet 2022-10-26 22:29:07 +02:00 committed by Robin Jarry
parent c31a5fc33d
commit e2f864f2a9

View file

@ -702,6 +702,9 @@ func (w *worker) handleCheckMail(msg *types.CheckMail) {
if err != nil { if err != nil {
w.err(msg, fmt.Errorf("checkmail: error running command: %w", err)) w.err(msg, fmt.Errorf("checkmail: error running command: %w", err))
} else { } else {
w.w.PostMessage(&types.DirectoryInfo{
Info: w.getDirectoryInfo(w.currentQueryName, w.query),
}, nil)
w.done(msg) w.done(msg)
} }
} }