aboutsummaryrefslogtreecommitdiff
path: root/bindings/python-cffi/notmuch2/_message.py
diff options
context:
space:
mode:
authorDavid Bremner <david@tethera.net>2022-02-15 20:53:12 -0400
committerDavid Bremner <david@tethera.net>2022-02-15 20:54:56 -0400
commitf1b2ab70c39cacb53c0b3c1d49358260a8d1818d (patch)
tree8b06d207475c256081a10ec5eb1fbd7c959610e0 /bindings/python-cffi/notmuch2/_message.py
parentcf342d7302544532a1f66fd7a1cc42df99fcd228 (diff)
parent7b5921877e748338359a25dae578771f768183af (diff)
Merge tag '0.35' into debian/bullseye-backportsdebian/0.35-1_bpo11+1archive/debian/0.35-1_bpo11+1
notmuch 0.35 release
Diffstat (limited to 'bindings/python-cffi/notmuch2/_message.py')
-rw-r--r--bindings/python-cffi/notmuch2/_message.py18
1 files changed, 16 insertions, 2 deletions
diff --git a/bindings/python-cffi/notmuch2/_message.py b/bindings/python-cffi/notmuch2/_message.py
index 2f232076..aa1cb875 100644
--- a/bindings/python-cffi/notmuch2/_message.py
+++ b/bindings/python-cffi/notmuch2/_message.py
@@ -206,6 +206,20 @@ class Message(base.NotmuchObject):
return bool(ret)
@property
+ def matched(self):
+ """Indicates whether this message was matched by the query.
+
+ When a thread is created from a search, some of the
+ messages may not match the original query. This property
+ is set to *True* for those that do match.
+
+ :raises ObjectDestroyedError: if used after destroyed.
+ """
+ ret = capi.lib.notmuch_message_get_flag(
+ self._msg_p, capi.lib.NOTMUCH_MESSAGE_FLAG_MATCH)
+ return bool(ret)
+
+ @property
def date(self):
"""The message date as an integer.
@@ -357,14 +371,14 @@ class Message(base.NotmuchObject):
This method will only work if the message was created from a
thread. Otherwise it will yield no results.
- :returns: An iterator yielding :class:`Message` instances.
+ :returns: An iterator yielding :class:`OwnedMessage` instances.
:rtype: MessageIter
"""
# The notmuch_messages_valid call accepts NULL and this will
# become an empty iterator, raising StopIteration immediately.
# Hence no return value checking here.
msgs_p = capi.lib.notmuch_message_get_replies(self._msg_p)
- return MessageIter(self, msgs_p, db=self._db)
+ return MessageIter(self, msgs_p, db=self._db, msg_cls=OwnedMessage)
def __hash__(self):
return hash(self.messageid)