aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/state/templates.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/state/templates.go b/lib/state/templates.go
index 2e351a7a..b5a5ee05 100644
--- a/lib/state/templates.go
+++ b/lib/state/templates.go
@@ -244,7 +244,14 @@ func (d *TemplateData) Subject() string {
}
func (d *TemplateData) SubjectBase() string {
- base, _ := sortthread.GetBaseSubject(d.Subject())
+ var subject string
+ switch {
+ case d.info != nil && d.info.Envelope != nil:
+ subject = d.info.Envelope.Subject
+ case d.headers != nil:
+ subject = d.Header("subject")
+ }
+ base, _ := sortthread.GetBaseSubject(subject)
return base
}