diff options
Diffstat (limited to 'alot/db/thread.py')
-rw-r--r-- | alot/db/thread.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/alot/db/thread.py b/alot/db/thread.py index 13ddabda..b6634b57 100644 --- a/alot/db/thread.py +++ b/alot/db/thread.py @@ -214,3 +214,14 @@ class Thread: thread_query = 'thread:%s AND (%s)' % (self.id, query) num_matches = self._dbman.count_messages(thread_query) return num_matches > 0 + + def count_matches(self, query): + """ + Count the number of messags in this thread that match the given notmuch + query. + + :param query: The query to check against + :type query: string + """ + thread_query = 'thread:%s AND (%s)' % (self.id, query) + return self._dbman.count_messages(thread_query) |