summaryrefslogtreecommitdiff
path: root/alot/db/message.py
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2020-02-06 17:08:00 +0100
committerAnton Khirnov <anton@khirnov.net>2020-02-06 17:11:05 +0100
commit48dac1d9089ce2a36c55dc4768b24293d1257a37 (patch)
treecf4e0c5751da8e7689269ea88b180b4dee3c3002 /alot/db/message.py
parent72ed7d40ac68d7e91f41e94fbcf6cb7a3e28433a (diff)
db: rewrite the API for representing message trees
It should be cleaner and easier to use, and eventually replace the custom tree walker in the thread display buffer.
Diffstat (limited to 'alot/db/message.py')
-rw-r--r--alot/db/message.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/alot/db/message.py b/alot/db/message.py
index 0b59090d..f9e8e37b 100644
--- a/alot/db/message.py
+++ b/alot/db/message.py
@@ -35,7 +35,10 @@ class Message:
"""value of the Message-Id header (str)"""
id = None
- def __init__(self, dbman, msg, thread):
+ """A list of replies to this message"""
+ replies = None
+
+ def __init__(self, dbman, msg, thread, replies):
"""
:param dbman: db manager that is used for further lookups
:type dbman: alot.db.DBManager
@@ -43,10 +46,13 @@ class Message:
:type msg: notmuch.database.Message
:param thread: this messages thread
:type thread: :class:`~alot.db.Thread`
+ :param replies: a list of replies to this message
+ :type replies alot.db.message.Message
"""
self._dbman = dbman
self.id = msg.get_message_id()
self.thread = thread
+ self.replies = replies
try:
self.date = datetime.fromtimestamp(msg.get_date())
except ValueError: