From 36b5885ec17743d608cf97a6eeed0e8638ea4c8c Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Thu, 2 Oct 2014 11:43:40 +0200 Subject: Allow configuring what does alot consider to be the thread subject. --- alot/db/thread.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'alot/db') diff --git a/alot/db/thread.py b/alot/db/thread.py index 4138db1d..a0df09f1 100644 --- a/alot/db/thread.py +++ b/alot/db/thread.py @@ -33,7 +33,17 @@ 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: + subject = list(thread.get_toplevel_messages())[0].get_header('subject') + except IndexError: + subject = '' + self._subject = subject + self._authors = None ts = thread.get_oldest_date() -- cgit v1.2.3