Exemplo n.º 1
0
// 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
}
Exemplo n.º 2
0
/**
 * 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
}