예제 #1
0
파일: thread.go 프로젝트: gmuch/gmuch
// TopLevelMessages returns an iterator for the top-level messages in the
// current thread in oldest-first order.
func (t *Thread) TopLevelMessages() *Messages {
	ret := &Messages{
		cptr:   unsafe.Pointer(C.notmuch_thread_get_toplevel_messages(t.toC())),
		parent: (*cStruct)(t),
	}
	setGcClose(ret)
	return ret
}
예제 #2
0
파일: notmuch.go 프로젝트: notmuch/notmuch
/**
 * Get a notmuch_messages_t iterator for the top-level messages in
 * 'thread' in oldest-first order.
 *
 * This iterator will not necessarily iterate over all of the messages
 * in the thread. It will only iterate over the messages in the thread
 * which are not replies to other messages in the thread.
 *
 * The returned list will be destroyed when the thread is destroyed.
 */
func (self *Thread) GetToplevelMessages() (*Messages, Status) {
	if self.thread == nil {
		return nil, STATUS_NULL_POINTER
	}

	msgs := C.notmuch_thread_get_toplevel_messages(self.thread)
	if msgs == nil {
		return nil, STATUS_NULL_POINTER
	}
	return &Messages{msgs}, STATUS_SUCCESS
}