From 5a9ac04474ed24c90522ccf878d2268db5ba0ae8 Mon Sep 17 00:00:00 2001 From: Kieran Bingham Date: Wed, 20 Oct 2021 00:55:54 +0100 Subject: [PATCH] widgets: thread: Include Subject in MessageSummary Replies to a parent message are not shown to avoid filling the buffer with noisy repeating content. Signed-off-by: Kieran Bingham --- alot/widgets/thread.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/alot/widgets/thread.py b/alot/widgets/thread.py index c5276df83..b5244fffd 100644 --- a/alot/widgets/thread.py +++ b/alot/widgets/thread.py @@ -78,9 +78,21 @@ def _render_wrap(size, focus=False): def __str__(self): author, address = self.message.get_author() date = self.message.get_datestring() + subject = self.message.get_subject() rep = author if author != '' else address if date is not None: rep += " (%s)" % date + + # Hide Subjects which are replies to the parent message. + # This allows threads containing multiple messages with distinct + # subjects to be displayed without adding noise to the replies. + parent = self.message.get_parent() + if parent: + psubject = parent.get_subject() + subject = subject.replace(psubject, "...") + + rep += ": " + subject + return rep def selectable(self):