aboutsummaryrefslogtreecommitdiffstats
path: root/worker/notmuch/eventhandlers.go
Commit message (Collapse)AuthorAgeFilesLines
* notmuch: simplify DirectoryInfo emitting logicJulian Pidancet2022-10-271-12/+9
| | | | | | | | | | | | | | | Refactor the code emitting DirectoryInfo messages. Reduce function call indirections by retiring gatherDirectoryInfo(), buildDirInfo() and emitDirectoryInfo(), and replacing them with getDirectoryInfo() (aligning the code with what is done in the maildir worker by the same occasion). Also merge queryFromName(), which no longer needs to be called from different places, in handleOpenDirectory(). Signed-off-by: Julian Pidancet <julian.pidancet@oracle.com> Acked-by: Robin Jarry <robin@jarry.cc> Acked-by: Tim Culverhouse <tim@timculverhouse.com>
* notmuch: make maildir store path configurableJulian Pidancet2022-10-271-11/+13
| | | | | | | | | | | | | | Add the "maildir-store" account configuration option to select the maildir store to associate with the notmuch database. This also allows the previous changes to be backward compatible since not specifying this option will make the backend behave the same as if there were no changes. Fixes: https://todo.sr.ht/~rjarry/aerc/73 Signed-off-by: Julian Pidancet <julian.pidancet@oracle.com> Acked-by: Robin Jarry <robin@jarry.cc> Acked-by: Tim Culverhouse <tim@timculverhouse.com>
* notmuch: add maildir supportJulian Pidancet2022-10-271-1/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | By associating the notmuch database with a maildir store, we can add the Copy/Move/Delete operations on messages to the notmuch backend. This change assumes that the notmuch database location is also the root of the maildir store. In a previous change, we added the ability to dynamically add and remove message files to the notmuch DB. This change uses this facility to synchronize the database with the filesystem operations on maildir files. While it's still possible to use the query-map file to create virtual folders from notmuch search queries, the sidebar is now loaded with the folders found in the maildir store. With notmuch, two identical but distinct message files can be indexed in the database with the same key. This change takes extra care of only deleting or removing message files from the maildir corresponding to the folder that is currently selected (if any). Implements: https://todo.sr.ht/~rjarry/aerc/88 Fixes: https://todo.sr.ht/~rjarry/aerc/73 Signed-off-by: Julian Pidancet <julian.pidancet@oracle.com> Acked-by: Robin Jarry <robin@jarry.cc> Acked-by: Tim Culverhouse <tim@timculverhouse.com>
* notmuch: fix cursor movement in threaded viewKoni Marti2022-07-311-1/+1
| | | | | | | | | | | | | | | | Set the SkipSort flag when sending directory infos for counting purposes. Without this, the directory infos would trigger a directory fetch which could bring the notmuch threads out of sync with the message list. The notmuch backend sends these directory infos automatically every minute. To reproduce the weird cursor movement in notmuch's threaded view: 1. enter threaded view in notmuch 2. wait 1 min (until the auto directory infos are sent out) 3. move cursor around and notice how it jumps over threads Signed-off-by: Koni Marti <koni.marti@gmail.com> Tested-by: Tim Culverhouse <tim@timculverhouse.com>
* logging: use level-based logger functionsRobin Jarry2022-07-231-1/+3
| | | | | | | | | | | | Do not pass logger objects around anymore. Shuffle some messages to make them consistent with the new logging API. Avoid using %v when a more specific verb exists for the argument types. The loggers are completely disabled (i.e. Sprintf is not even called) by default. They are only enabled when redirecting stdout to a file. Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Moritz Poldrack <moritz@poldrack.dev>
* format: reformat code with go 1.17Robin Jarry2021-12-111-1/+2
| | | | | | | | There was a change in how build tags are formatted. Use this as new reference. Link: https://go.dev/doc/go1.17#gofmt Signed-off-by: Robin Jarry <robin@jarry.cc>
* Add missing notmuch build tagsJeffas2020-02-261-0/+2
|
* notmuch: refresh dirlist in backgroundReto Brunner2020-02-161-1/+14
|
* notmuch: add internal event loopReto Brunner2020-02-161-0/+9