VALUE
notmuch_rb_thread_get_toplevel_messages (VALUE self);
+VALUE
+notmuch_rb_thread_get_messages (VALUE self);
+
VALUE
notmuch_rb_thread_get_matched_messages (VALUE self);
rb_define_method (notmuch_rb_cThread, "thread_id", notmuch_rb_thread_get_thread_id, 0); /* in thread.c */
rb_define_method (notmuch_rb_cThread, "total_messages", notmuch_rb_thread_get_total_messages, 0); /* in thread.c */
rb_define_method (notmuch_rb_cThread, "toplevel_messages", notmuch_rb_thread_get_toplevel_messages, 0); /* in thread.c */
+ rb_define_method (notmuch_rb_cThread, "messages", notmuch_rb_thread_get_messages, 0); /* in thread.c */
rb_define_method (notmuch_rb_cThread, "matched_messages", notmuch_rb_thread_get_matched_messages, 0); /* in thread.c */
rb_define_method (notmuch_rb_cThread, "authors", notmuch_rb_thread_get_authors, 0); /* in thread.c */
rb_define_method (notmuch_rb_cThread, "subject", notmuch_rb_thread_get_subject, 0); /* in thread.c */
return Data_Wrap_Struct (notmuch_rb_cMessages, NULL, NULL, messages);
}
+/*
+ * call-seq: THREAD.messages => MESSAGES
+ *
+ * Get a Notmuch::Messages iterator for the all messages in thread.
+ */
+VALUE
+notmuch_rb_thread_get_messages (VALUE self)
+{
+ notmuch_messages_t *messages;
+ notmuch_thread_t *thread;
+
+ Data_Get_Notmuch_Thread (self, thread);
+
+ messages = notmuch_thread_get_messages (thread);
+ if (!messages)
+ rb_raise (notmuch_rb_eMemoryError, "Out of memory");
+
+ return Data_Wrap_Struct (notmuch_rb_cMessages, NULL, NULL, messages);
+}
+
/*
* call-seq: THREAD.matched_messages => fixnum
*