Commit Graph

8 Commits

Author SHA1 Message Date
Julian Pidancet fbff8cf0ac notmuch: make maildir store path configurable
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>
2022-10-27 21:45:31 +02:00
Julian Pidancet c7bfe4e490 notmuch: add maildir support
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>
2022-10-27 21:45:24 +02:00
Koni Marti 318f7d252c notmuch: fix cursor movement in threaded view
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>
2022-07-31 20:02:46 +02:00
Robin Jarry cd19995557 logging: use level-based logger functions
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>
2022-07-23 22:52:15 +02:00
Robin Jarry b331371a65 format: reformat code with go 1.17
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>
2021-12-11 23:24:08 +01:00
Jeffas 00ed2ef06a Add missing notmuch build tags 2020-02-26 21:46:31 +01:00
Reto Brunner 78dd043057 notmuch: refresh dirlist in background 2020-02-16 10:41:19 -05:00
Reto Brunner 8d216ab10e notmuch: add internal event loop 2020-02-16 10:41:18 -05:00