diff options
Diffstat (limited to 'alot/db/thread.py')
-rw-r--r-- | alot/db/thread.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/alot/db/thread.py b/alot/db/thread.py index 1f9ae7f0..37cc5fc7 100644 --- a/alot/db/thread.py +++ b/alot/db/thread.py @@ -61,13 +61,10 @@ class Thread: self.message_list = [] self.messages = {} - self.refresh(thread) + self._refresh(thread) - def refresh(self, thread = None): + def _refresh(self, thread): """refresh thread metadata from the index""" - if not thread: - thread = self._dbman._get_notmuch_thread(self.id) - self.total_messages = len(thread) self._notmuch_authors_string = thread.authors @@ -97,6 +94,11 @@ class Thread: self.messages, self.toplevel_messages, self.message_list = self._gather_messages(thread) + def refresh(self): + with self._dbman._db_ro() as db: + thread = self._dbman._get_notmuch_thread(db, self.id) + self._refresh(thread) + def _gather_messages(self, thread): msgs = {} msg_tree = [] |