maildir: do not send dircontents on fs event

The maildir worker watches the file system for events (new mail, moved
mail, copied mail, etc). On an event, the worker sends a
DirectoryContents message and a DirectoryInfo message.

Do not send DirectoryContents on FS Event in the maildir worker. The
DirectoryInfo message already triggers the UI to request the new
DirectoryContents, and does so in a more predictable way (IE any
currently applied filter is applied).

Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
Acked-by: Robin Jarry <robin@jarry.cc>
This commit is contained in:
Tim Culverhouse 2022-08-30 10:28:46 -05:00 committed by Robin Jarry
parent 8eab829649
commit 921382a9bf

View file

@ -115,19 +115,6 @@ func (w *Worker) handleFSEvent(ev fsnotify.Event) {
return return
} }
uids, err := w.c.UIDs(*w.selected)
if err != nil {
logging.Errorf("could not scan UIDs: %w", err)
return
}
sortedUids, err := w.sort(uids, w.currentSortCriteria)
if err != nil {
logging.Errorf("error sorting directory: %w", err)
return
}
w.worker.PostMessage(&types.DirectoryContents{
Uids: sortedUids,
}, nil)
dirInfo := w.getDirectoryInfo(w.selectedName) dirInfo := w.getDirectoryInfo(w.selectedName)
w.worker.PostMessage(&types.DirectoryInfo{ w.worker.PostMessage(&types.DirectoryInfo{
Info: dirInfo, Info: dirInfo,