示例#1
0
/* Get the thread ID of 'message'.
 *
 * The returned string belongs to 'message' and as such, should not be
 * modified by the caller and will only be valid for as long as the
 * message is valid, (for example, until the user calls
 * notmuch_message_destroy on 'message' or until a query from which it
 * derived is destroyed).
 *
 * This function will not return NULL since Notmuch ensures that every
 * message belongs to a single thread.
 */
func (self *Message) GetThreadId() string {

	if self.message == nil {
		return ""
	}
	id := C.notmuch_message_get_thread_id(self.message)
	// we dont own id
	// defer C.free(unsafe.Pointer(id))

	if id == nil {
		return ""
	}

	return C.GoString(id)
}
示例#2
0
文件: message.go 项目: gmuch/gmuch
// ThreadID returns the ID of the thread to which this message belongs to.
func (m *Message) ThreadID() string {
	return C.GoString(C.notmuch_message_get_thread_id(m.toC()))
}