aboutsummaryrefslogtreecommitdiffstats
path: root/worker
diff options
context:
space:
mode:
authorJulio B <julio.bacel@gmail.com>2024-03-06 01:11:05 +0200
committerRobin Jarry <robin@jarry.cc>2024-04-13 21:46:32 +0200
commit941e2e9e7de058f9e6e10efab1ece8be4188468e (patch)
tree85907c9c23171768c9ba9c41d42f8e802ece3039 /worker
parent672b4edca7af2303cfcb1d69a676556d12476b5f (diff)
downloadaerc-941e2e9e7de058f9e6e10efab1ece8be4188468e.tar.gz
ui: use a custom prefix for dummy root
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>
Diffstat (limited to 'worker')
-rw-r--r--worker/notmuch/lib/database.go1
-rw-r--r--worker/types/thread.go3
2 files changed, 4 insertions, 0 deletions
diff --git a/worker/notmuch/lib/database.go b/worker/notmuch/lib/database.go
index bd0bc639..7216274a 100644
--- a/worker/notmuch/lib/database.go
+++ b/worker/notmuch/lib/database.go
@@ -138,6 +138,7 @@ func (db *DB) ThreadsFromQuery(ctx context.Context, q string, entireThread bool)
tlm := thread.TopLevelMessages()
root := db.makeThread(nil, &tlm, entireThread)
if len(root) > 1 {
+ root[0].Dummy = true
root[0].FirstChild = root[0].NextSibling
root[0].NextSibling.PrevSibling = nil
root[0].NextSibling = nil
diff --git a/worker/types/thread.go b/worker/types/thread.go
index 8705ace1..a79a0b2d 100644
--- a/worker/types/thread.go
+++ b/worker/types/thread.go
@@ -18,6 +18,9 @@ type Thread struct {
Hidden int // if this flag is not zero the message isn't rendered in the UI
Deleted bool // if this flag is set the message was deleted
+ // if this flag is set the message is the root of an incomplete thread
+ Dummy bool
+
// Context indicates the message doesn't match the mailbox / query but
// is displayed for context
Context bool