diff options
| author | Danilo M. <danix@danix.xyz> | 2026-08-08 10:16:25 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-08-10 08:23:04 +0200 |
| commit | c49d1317f95e435e5b5af0d0352e6743a5d57025 (patch) | |
| tree | 77ca9ad2ba5962193b8e650a1c57ebd3360b62fb /src/types.h | |
| parent | bc9b22fda26ac47d5870099b281b63592996722d (diff) | |
| download | qtmaildir-c49d1317f95e435e5b5af0d0352e6743a5d57025.tar.gz qtmaildir-c49d1317f95e435e5b5af0d0352e6743a5d57025.zip | |
feat(worker): load a thread as a reply tree with per-message depth
loadThread could not be extended to do this. It walks
notmuch_query_search_messages, and a message obtained that way returns NULL from
notmuch_message_get_replies (notmuch.h:1617-1628), so that walk cannot produce
reply depth at all. The tree comes from notmuch_thread_get_toplevel_messages
instead, and the pane keeps the flat list it wants.
walkReplies takes raw notmuch_message_t*, against this file's rule that every
handle is RAII-owned. Messages reached through a thread are freed with it
(notmuch.h:1637), so an NmMessage wrapper would destroy memory the thread frees
again. The NmThread in the caller is what keeps them alive.
Every message in the thread gets a node regardless of the query: the list is
where the reply count is read, and hiding unmatched replies would make that
count disagree with the rows under it.
Both tests mutation-checked. Flattening depth fails the depth assertion, and
skipping the thread walk fails it too, so neither passes against the two
mistakes the notmuch API invites.
Diffstat (limited to 'src/types.h')
| -rw-r--r-- | src/types.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/types.h b/src/types.h index 6b2ca4c..ef822b9 100644 --- a/src/types.h +++ b/src/types.h @@ -124,5 +124,6 @@ struct DatabaseStats Q_DECLARE_METATYPE(ThreadSummary) Q_DECLARE_METATYPE(MessageRef) +Q_DECLARE_METATYPE(MessageNode) Q_DECLARE_METATYPE(TagChange) Q_DECLARE_METATYPE(DatabaseStats) |
