aboutsummaryrefslogtreecommitdiffstats
path: root/lib/state/templates.go
diff options
context:
space:
mode:
authorKoni Marti <koni.marti@gmail.com>2023-07-18 10:29:52 +0200
committerRobin Jarry <robin@jarry.cc>2024-06-25 15:28:11 +0200
commit7f66297c521fca8f9bc17280f0a96874598bde96 (patch)
tree643e1d5c6dbbf55814c689f2509f3eb9bd532fa2 /lib/state/templates.go
parent9cd806fa6e80829753ecd3356e19044d6e210826 (diff)
downloadaerc-7f66297c521fca8f9bc17280f0a96874598bde96.tar.gz
threadbuilder: show siblings even when no parent found
Show all threading associations even when not all nodes are present. Indicate if a thread is incomplete, i.e. misses a direct parent node. Use the `msglist_thread_orphan.fg=red` styleobject in your stylesheet to indicate whether a messsage has a missing parent. Also use a different thread prefix ("┬─" instead of "├─") not to confuse them with regular threads that have a visible parent. Signed-off-by: Koni Marti <koni.marti@gmail.com> Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Matěj Cepl <mcepl@cepl.eu>
Diffstat (limited to 'lib/state/templates.go')
-rw-r--r--lib/state/templates.go18
1 files changed, 8 insertions, 10 deletions
diff --git a/lib/state/templates.go b/lib/state/templates.go
index e5206cf0..868f9184 100644
--- a/lib/state/templates.go
+++ b/lib/state/templates.go
@@ -28,7 +28,7 @@ type DataSetter interface {
SetHeaders(*mail.Header, *models.OriginalMail)
SetInfo(*models.MessageInfo, int, bool)
SetVisual(bool)
- SetThreading(string, bool, int, int, bool, bool)
+ SetThreading(ThreadInfo)
SetComposer(Composer)
SetAccount(*config.AccountConfig)
SetFolder(*models.Directory)
@@ -44,6 +44,7 @@ type ThreadInfo struct {
Unread int
Folded bool
Context bool
+ Orphan bool
}
type templateData struct {
@@ -100,15 +101,8 @@ func (d *templateData) SetVisual(visual bool) {
d.visual = visual
}
-func (d *templateData) SetThreading(prefix string, same bool, count int,
- unread int, folded bool, context bool,
-) {
- d.threadInfo.Prefix = prefix
- d.threadInfo.SameSubject = same
- d.threadInfo.Count = count
- d.threadInfo.Unread = unread
- d.threadInfo.Folded = folded
- d.threadInfo.Context = context
+func (d *templateData) SetThreading(info ThreadInfo) {
+ d.threadInfo = info
}
func (d *templateData) SetAccount(acct *config.AccountConfig) {
@@ -334,6 +328,10 @@ func (d *templateData) ThreadContext() bool {
return d.threadInfo.Context
}
+func (d *templateData) ThreadOrphan() bool {
+ return d.threadInfo.Orphan
+}
+
func (d *templateData) Subject() string {
var subject string
switch {