summaryrefslogtreecommitdiff
path: root/alot
diff options
context:
space:
mode:
authorMichael Stapelberg <michael+gh@stapelberg.de>2012-05-16 23:49:04 +0300
committerMichael Stapelberg <michael+gh@stapelberg.de>2012-05-16 23:49:04 +0300
commitbc8f9adcc81c504fbddaeba0396b542e0aa38956 (patch)
treeb6db47dc3dbec3bcf8b116fe326e01b48855faf6 /alot
parent2cb5996bc6cea048b981ea26bdfe90d8ae7dcd60 (diff)
threadlist: make display_content use the most recent messages instead of *random* messages
Diffstat (limited to 'alot')
-rw-r--r--alot/widgets.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/alot/widgets.py b/alot/widgets.py
index fec069af..4feca69d 100644
--- a/alot/widgets.py
+++ b/alot/widgets.py
@@ -155,7 +155,8 @@ class ThreadlineWidget(urwid.AttrMap):
msgs = self.thread.get_messages().keys()
else:
msgs = []
- msgs.sort()
+ # sort the most recent messages first
+ msgs.sort(key=lambda msg: msg.get_date(), reverse=True)
lastcontent = ' '.join([m.get_text_content() for m in msgs])
contentstring = lastcontent.replace('\n', ' ').strip()
self.content_w = urwid.AttrMap(urwid.Text(