From c13df799763c6b584cf4963e125361bb16c0e07d Mon Sep 17 00:00:00 2001 From: inwit Date: Thu, 9 Nov 2023 21:35:04 +0100 Subject: threads: add .ThreadUnread to template data When a thread is folded, it can be useful to know how many unseen messages lie below the root. For example, one might want to show that count in the message list: column-folded = {{if .ThreadFolded \ }}{{if ne .ThreadUnread 0 \ }}{{.ThreadUnread | printf "%s/"}}{{ \ end}}{{ .ThreadCount | printf "%s"}}{{end}} Add `.ThreadUnread` to the template functions. Changelog-added: `.ThreadUnread` is now available in templates. Signed-off-by: inwit Acked-by: Robin Jarry --- config/templates.go | 1 + 1 file changed, 1 insertion(+) (limited to 'config') diff --git a/config/templates.go b/config/templates.go index e2adeac2..cab8efb2 100644 --- a/config/templates.go +++ b/config/templates.go @@ -77,6 +77,7 @@ func (d *dummyData) DateAutoFormat(time.Time) string { return "" } func (d *dummyData) Header(string) string { return "" } func (d *dummyData) ThreadPrefix() string { return "└─>" } func (d *dummyData) ThreadCount() int { return 0 } +func (d *dummyData) ThreadUnread() int { return 0 } func (d *dummyData) ThreadFolded() bool { return false } func (d *dummyData) ThreadContext() bool { return true } func (d *dummyData) Subject() string { return "Re: [PATCH] hey" } -- cgit