Skip to content

Commit a9f8848

Browse files
committed
display per message subjects in thread widget
Many senders to not quite grasp the concept of a mail thread, and this "hijack" a thread by replying and changing the subject. In addition, there may be good reasons for replies with changed subject, such as an adjustment of status or the typical patch series threads with individual topics. Currently, all this information is hidden in collapsed view but may be valuable for expanding the right message. Therefore, provide individual subjects for the messages in thread view.
1 parent 7915ea6 commit a9f8848

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

alot/db/message.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ def __init__(self, dbman, msg, thread=None):
6868
self._from = '"{}" <{}>'.format(acc.realname, str(acc.address))
6969
else:
7070
self._from = '"Unknown" <>'
71+
self._subject = decode_header(msg.header('Subject'))
7172

7273
def __str__(self):
7374
"""prettyprint the message"""
@@ -132,6 +133,9 @@ def get_message_parts(self):
132133
if not msg.is_multipart():
133134
yield msg
134135

136+
def get_subject(self):
137+
return self._subject
138+
135139
def get_tags(self):
136140
"""returns tags attached to this message as list of strings"""
137141
return sorted(self._tags)

alot/widgets/thread.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,12 @@ def _render_wrap(size, focus=False):
7878
def __str__(self):
7979
author, address = self.message.get_author()
8080
date = self.message.get_datestring()
81+
subject = self.message.get_subject()
8182
rep = author if author != '' else address
8283
if date is not None:
8384
rep += " (%s)" % date
85+
if subject:
86+
rep += ": %s" % subject
8487
return rep
8588

8689
def selectable(self):

0 commit comments

Comments
 (0)