+ def get_flag(self, flag):
+ """Checks whether a specific flag is set for this message
+
+ The method :meth:`Query.search_threads` sets
+ *Message.FLAG.MATCH* for those messages that match the
+ query. This method allows us to get the value of this flag.
+
+ :param flag: One of the :attr:`Message.FLAG` values (currently only
+ *Message.FLAG.MATCH*
+ :returns: A bool, indicating whether the flag is set.
+ :exception: :exc:`NotmuchError` STATUS.NOT_INITIALIZED if the message
+ is not initialized.
+ """
+ if self._msg is None:
+ raise NotmuchError(STATUS.NOT_INITIALIZED)
+ return Message._get_flag(self._msg, flag)
+
+ def set_flag(self, flag, value):
+ """Sets/Unsets a specific flag for this message
+
+ :param flag: One of the :attr:`Message.FLAG` values (currently only
+ *Message.FLAG.MATCH*
+ :param value: A bool indicating whether to set or unset the flag.
+
+ :returns: Nothing
+ :exception: :exc:`NotmuchError` STATUS.NOT_INITIALIZED if the message
+ is not initialized.
+ """
+ if self._msg is None:
+ raise NotmuchError(STATUS.NOT_INITIALIZED)
+ nmlib.notmuch_message_set_flag(self._msg, flag, value)
+