summaryrefslogtreecommitdiff
path: root/alot
diff options
context:
space:
mode:
authorPatrick Totzke <patricktotzke@gmail.com>2015-12-16 16:15:57 +0000
committerPatrick Totzke <patricktotzke@gmail.com>2015-12-16 16:15:57 +0000
commit539c5e7d46d2492a89a1b4f93a6e3b5e08a47db7 (patch)
tree10c8f9e8f5903476e005926105e13271c07667b7 /alot
parent81b010380a373ee11454f3baeac718a545239a08 (diff)
parent36b5885ec17743d608cf97a6eeed0e8638ea4c8c (diff)
Merge branch '0.3.6-feature-subjects-729'
Diffstat (limited to 'alot')
-rw-r--r--alot/db/thread.py12
-rw-r--r--alot/defaults/alot.rc.spec9
2 files changed, 20 insertions, 1 deletions
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()
diff --git a/alot/defaults/alot.rc.spec b/alot/defaults/alot.rc.spec
index cf4fb6de..4691a7dc 100644
--- a/alot/defaults/alot.rc.spec
+++ b/alot/defaults/alot.rc.spec
@@ -49,6 +49,15 @@ thread_authors_replace_me = boolean(default=True)
# :ref:`thread_authors_replace_me <thread-authors-replace-me>`
thread_authors_me = string(default='Me')
+# What should be considered to be "the thread subject".
+# Valid values are:
+#
+# * 'notmuch' (the default), will use the thread subject from notmuch, which
+# depends on the selected sorting method
+# * 'oldest' will always use the subject of the oldest message in the thread as
+# the thread subject
+thread_subject = option('oldest', 'notmuch', default='notmuch')
+
# set terminal command used for spawning shell commands
terminal_cmd = string(default='x-terminal-emulator -e')