summaryrefslogtreecommitdiff
path: root/alot/db/thread.py
diff options
context:
space:
mode:
Diffstat (limited to 'alot/db/thread.py')
-rw-r--r--alot/db/thread.py15
1 files changed, 13 insertions, 2 deletions
diff --git a/alot/db/thread.py b/alot/db/thread.py
index 4138db1d..8bb94a10 100644
--- a/alot/db/thread.py
+++ b/alot/db/thread.py
@@ -33,7 +33,18 @@ class Thread(object):
self._total_messages = thread.get_total_messages()
self._notmuch_authors_string = thread.get_authors()
- self._subject = thread.get_subject()
+
+ subject_type = settings.get('thread_subject')
+ if subject_type == 'notmuch':
+ subject = thread.get_subject()
+ elif subject_type == 'oldest':
+ try:
+ first_msg = list(thread.get_toplevel_messages())[0]
+ subject = first_msg.get_header('subject')
+ except IndexError:
+ subject = ''
+ self._subject = subject
+
self._authors = None
ts = thread.get_oldest_date()
@@ -176,7 +187,7 @@ class Thread(object):
aname = settings.get('thread_authors_me')
if not aname:
aname = aaddress
- if not aname in authorslist:
+ if aname not in authorslist:
authorslist.append(aname)
return ', '.join(authorslist)
else: