Example #1
0
/* Thaw the current 'message', synchronizing any changes that may have
 * occurred while 'message' was frozen into the notmuch database.
 *
 * See notmuch_message_freeze for an example of how to use this
 * function to safely provide tag changes.
 *
 * Multiple calls to freeze/thaw are valid and these calls with
 * "stack". That is there must be as many calls to thaw as to freeze
 * before a message is actually thawed.
 *
 * Return value:
 *
 * NOTMUCH_STATUS_SUCCESS: Message successfully thawed, (or at least
 *	its frozen count has successfully been reduced by 1).
 *
 * NOTMUCH_STATUS_UNBALANCED_FREEZE_THAW: An attempt was made to thaw
 *	an unfrozen message. That is, there have been an unbalanced
 *	number of calls to notmuch_message_freeze and
 *	notmuch_message_thaw.
 */
func (self *Message) Thaw() Status {
	if self.message == nil {
		return STATUS_NULL_POINTER
	}

	return Status(C.notmuch_message_thaw(self.message))
}
Example #2
0
// Atomic allows a transactional change of tags to the message.
func (m *Message) Atomic(callback func(*Message)) error {
	if err := statusErr(C.notmuch_message_freeze(m.toC())); err != nil {
		return err
	}
	callback(m)
	return statusErr(C.notmuch_message_thaw(m.toC()))
}