| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
| |
The current implementation assumes that 'root[0].FirstChild' is nil, but
this is not always the case. Instead of overwriting the FirstChild,
detect and link the messages to the LastChild of root[0].
Fixes: 672b4edca7af ("notmuch: draw incomplete threads")
Signed-off-by: Julio B <julio.bacel@gmail.com>
Tested-by: Inwit <inwit@sindominio.net>
Acked-by: Robin Jarry <robin@jarry.cc>
|
|
|
|
|
|
|
|
|
|
| |
These messages are not really the root of the thread, and should not be
displayed as such. Add a new special prefix to make them appear like
the first child of a rootless thread.
Signed-off-by: Julio B <julio.bacel@gmail.com>
Tested-by: Inwit <inwit@sindominio.net>
Acked-by: Robin Jarry <robin@jarry.cc>
|
|
|
|
|
|
|
|
|
|
| |
Create a "pseudo thread" with the first message as root. This is a
temporary solution, until we have a more generic implementation of dummy
messages that works for all backends.
Signed-off-by: Julio B <julio.bacel@gmail.com>
Tested-by: Inwit <inwit@sindominio.net>
Acked-by: Robin Jarry <robin@jarry.cc>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
According to the comments in notmuch.h, removing a file returns
NOTMUCH_STATUS_DUPLICATE_MESSAGE_ID when the "filename was removed but
the message persists in the database with at least one other filename."
Based on the fact that the db.DeleteMessage() function is used in a
context that explicitly recognizes the possibility of multiple files and
only attempts to delete one of them, I'm fairly certain that the
existing behavior of ignoring all errors *except* the deplicate message
ID error is the result of a typo. (It also doesn't make sense to ignore
other errors, such as NOTMUCH_STATUS_XAPIAN_EXCEPTION.)
Cc: Tim Culverhouse <tim@timculverhouse.com>
Signed-off-by: Jason Cox <me@jasoncarloscox.com>
Tested-by: Maarten Aertsen <maarten@nlnetlabs.nl>
Acked-by: Robin Jarry <robin@jarry.cc>
|
|
|
|
|
|
|
| |
This has nothing to do at the root of the source tree.
Signed-off-by: Robin Jarry <robin@jarry.cc>
Acked-by: Bence Ferdinandy <bence@ferdinandy.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A folder may be defined based on the notmuch query `*`, which matches
all messages. This query is a special case (see notmuch-search-terms(7))
and cannot be combined with other queries. When adding to a `*` query,
such as when searching, simply replace `*` with the more specific query
rather than combining the two.
Changelog-fixed: Notmuch folders defined by the query `*` handle
search, filter, and unread counts correctly.
Signed-off-by: Jason Cox <me@jasoncarloscox.com>
Tested-by: Inwit <inwit@sindominio.net>
Acked-by: Robin Jarry <robin@jarry.cc>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Consider a thread with a root message and three child messages, each of
which has a single child message, like so:
root
child 1
grandchild 1a
child 2
grandchild 2a
child 3
grandchild 3a
With the previous implementation, if child 2 (or child 3) is not shown
by the current query, then grandchild 2a (or grandchild 3a) will not be
shown either. Ensure that this bug does not occur; that is, ensure that
children of non-queried non-first-child messages are shown in threads.
A more complex implementation is possible that maintains only a single
loop over the messages, but thinking about it made my head hurt. Use a
second (at times redundant) loop instead for simplicity's sake.
Changelog-fixed: Don't lose child messages of non-queried parents in
notmuch threads
Signed-off-by: Jason Cox <me@jasoncarloscox.com>
Acked-by: Robin Jarry <robin@jarry.cc>
Tested-by: Inwit <inwit@sindominio.net>
|
|
|
|
|
|
|
| |
Extend the :fold/:unfold behaviour to allow for multiple folding levels.
Signed-Off-By: inwit <inwit@sindominio.net>
Acked-by: Robin Jarry <robin@jarry.cc>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Notmuch threads can silently drop sibling messages during threading when
a thread has multiple "top level messages" (IE a thread where the root
is missing). Modify makeThread to return a slice of all encountered
siblings and add these as individual threads.
Note that the current implementation does not link these threads
together with a dummy parent node. This should be done in the future
when rendering of these types of threads is implemented
Fixes: https://todo.sr.ht/~rjarry/aerc/188
Reported-by: inwit <inwit@sindominio.net>
Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
Signed-off-by: inwit <inwit@sindominio.net>
Acked-by: Robin Jarry <robin@jarry.cc>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add a UI config value to enable showing of "thread-context", similar
to `notmuch show --entire-thread=true`. Add an associated style called
"msglist_thread_context" which can be used to style such messages.
Currently this feature is only supported by notmuch. It would be
possible for maildir to implement as well, IMAP with gmail custom
extensions, and JMAP. This patch merely implements the notmuch version
and puts the groundwork in for handling these sorts of displays.
Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
Tested-by: Inwit <inwit@sindominio.net>
Acked-by: Robin Jarry <robin@jarry.cc>
|
|
|
|
|
|
|
|
|
| |
For proper thread ordering, notmuch needs to use a SORT_NEWEST_FIRST
sort order in it's query, and then we reverse the thread order. Also
give a maximum guess for size of slice we'll be returning.
Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
Acked-by: Robin Jarry <robin@jarry.cc>
|
|
|
|
|
|
|
|
|
| |
Track the notmuch database state. When a state change is detected, query
if any changes affect the current query then send updates accordingly.
Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
Tested-by: Inwit <inwit@sindominio.net>
Acked-by: Robin Jarry <robin@jarry.cc>
|
|
|
|
|
|
|
| |
Replace the notmuch library used with our internal bindings.
Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
Acked-by: Robin Jarry <robin@jarry.cc>
|
|
|
|
|
|
|
|
|
| |
Implement cancellation of cancellable requests. These include listing of
directory contents, searching, and sorting.
Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
Tested-by: Bence Ferdinandy <bence@ferdinandy.com>
Acked-by: Robin Jarry <robin@jarry.cc>
|
|
|
|
|
|
|
|
|
|
|
| |
Use fswatcher to watch the underlying notmuch db to trigger directory
updates. Remove unused argument in the handleUpdateDirCounts function.
Call this function when listing directories to initialize counts when
starting aerc.
Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
Tested-by: Ben Lee-Cohen <ben@lee-cohen.com>
Acked-by: Robin Jarry <robin@jarry.cc>
|
|
|
|
|
|
|
|
|
|
| |
Use the same name than the builtin "log" package. That way, we do not
risk logging in the wrong place.
Suggested-by: Tim Culverhouse <tim@timculverhouse.com>
Signed-off-by: Robin Jarry <robin@jarry.cc>
Tested-by: Bence Ferdinandy <bence@ferdinandy.com>
Acked-by: Tim Culverhouse <tim@timculverhouse.com>
|
|
|
|
|
|
|
|
|
| |
Add a method to retrieve the message key associated with a message file
path, if indexed in the database.
Signed-off-by: Julian Pidancet <julian.pidancet@oracle.com>
Acked-by: Robin Jarry <robin@jarry.cc>
Acked-by: Tim Culverhouse <tim@timculverhouse.com>
|
|
|
|
|
|
|
|
|
|
| |
Print "failed to remove tag" instead of "failed to add tag" when
removing tag failed.
Fixes: 5ca6022d007b ("lint: ensure errors are at least logged (errcheck)")
Signed-off-by: Julian Pidancet <julian.pidancet@oracle.com>
Acked-by: Robin Jarry <robin@jarry.cc>
Acked-by: Tim Culverhouse <tim@timculverhouse.com>
|
|
|
|
|
|
|
|
|
| |
The new IndexFile and DeleteMessage allow dynamically inserting and
removing files to/from a notmuch database.
Signed-off-by: Julian Pidancet <julian.pidancet@oracle.com>
Acked-by: Robin Jarry <robin@jarry.cc>
Acked-by: Tim Culverhouse <tim@timculverhouse.com>
|
|
|
|
|
|
|
|
|
|
| |
Multiple files on the filesystem can be referenced under a single key in
the notmuch database. MsgFilenames() returns a list of filenames
associated with an index key.
Signed-off-by: Julian Pidancet <julian.pidancet@oracle.com>
Acked-by: Robin Jarry <robin@jarry.cc>
Acked-by: Tim Culverhouse <tim@timculverhouse.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fix reggression introduced by 70bfcfef4257 ("lint: work nicely with
wrapped errors (errorlint)").
Discovered this because it broke my arec-notmuch config where I have
`exclude-tags=deleted`. Queries with `tag:deleted` would now fail with
error message saying "Argument was ignored".
Fixes: 70bfcfef4257 ("lint: work nicely with wrapped errors (errorlint)")
Signed-off-by: Jose Lombera <jose@lombera.dev>
Acked-by: Robin Jarry <robin@jarry.cc>
|
|
|
|
|
|
|
|
| |
Error wrapping as introduced in Go 1.13 adds some additional logic to
use for comparing errors and adding information to it.
Signed-off-by: Moritz Poldrack <moritz@poldrack.dev>
Acked-by: Robin Jarry <robin@jarry.cc>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Apply GoDoc comment policy (comments for humans should have a space
after the //; machine-readable comments shouldn't)
Use strings.ReplaceAll instead of strings.Replace when appropriate
Remove if/else chains by replacing them with switches
Use short assignment/increment notation
Replace single case switches with if statements
Combine else and if when appropriate
Signed-off-by: Moritz Poldrack <moritz@poldrack.dev>
Acked-by: Robin Jarry <robin@jarry.cc>
|
|
|
|
|
| |
Signed-off-by: Moritz Poldrack <moritz@poldrack.dev>
Acked-by: Robin Jarry <robin@jarry.cc>
|
|
|
|
|
|
|
| |
Run `make fmt`.
Signed-off-by: Moritz Poldrack <git@moritz.sh>
Acked-by: Robin Jarry <robin@jarry.cc>
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Notmuch server-side threading added messages within a thread that didn't
match the query into the uidstore. By doing so, several UI issues
presented:
* All "hidden" messages displayed at the bottom of the msglist
* Selected messages wouldn't open properly
This patch stops these messages from being put into the message store,
thereby resolving the UI issues
Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
Acked-by: Koni Marti <koni.marti@gmail.com>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Display threads in the message list. For now, only supported by the
notmuch backend and on IMAP when the server supports the THREAD
extension.
Setting threading-enable=true is global and will cause the message list
to be empty with maildir:// accounts.
Co-authored-by: Kevin Kuehler <keur@xcf.berkeley.edu>
Co-authored-by: Reto Brunner <reto@labrat.space>
Signed-off-by: Robin Jarry <robin@jarry.cc>
|
|
|
|
|
|
|
| |
We frequently had issues with notmuch segfaulting and my guess is that this
was due to the garbage collection magic used in the module.
This changes to a fork that ripped the functionality out.
|
| |
|
|
|
|
|
| |
There seems to be some race with the automatic closing that should happen
in theory... close it manually where we can to avoid the issue
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Opening a notmuch DB gives you a snapshot of the stage at that specific time.
Prior to this, we only reopened the DB upon writing.
However, if say a mail sync program like offlineimap is fetching new mail,
we would never pick it up.
This commit caches a db for a while, so that we don't generate too much overhead
and does a reconnect cycle after that.
I hardcoded a value as I don't think that having an option would be beneficial.
Any write operation (meaning reading mail) anyhow flushes the DB by necessity.
(we need to close to commit tag changes, which changing the read state is)
|
| |
|
|
|
|
| |
Syncs back special notmuch tag like unread to the underlying maildir store
|
|
For some reason the current code frequently segfaults due to an
invalid C memory address. This commit mediates that by never keeping an object
alive longer than absolutely necessary.
|