aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/notmuch.h
diff options
context:
space:
mode:
authorGravatar Carl Worth <cworth@cworth.org>2009-11-15 20:39:25 -0800
committerGravatar Carl Worth <cworth@cworth.org>2009-11-15 20:41:45 -0800
commit933caf814fcbbb7420d03ef42bb37bea6dd90449 (patch)
treea96e78c60ee4c94cdd92a092746dadd594c89b15 /lib/notmuch.h
parent819f964d9a8cf5c92c5d13e8d1f1ac908f159a8c (diff)
notmuch show: Implement proper thread ordering/nesting of messages.
We now properly analyze the in-reply-to headers to create a proper tree representing the actual thread and present the messages in this correct thread order. Also, there's a new "depth:" value added to the "message{" header so that clients can format the thread as desired, (such as by indenting replies).
Diffstat (limited to 'lib/notmuch.h')
-rw-r--r--lib/notmuch.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/lib/notmuch.h b/lib/notmuch.h
index d0b0d9e4..32b53328 100644
--- a/lib/notmuch.h
+++ b/lib/notmuch.h
@@ -477,6 +477,21 @@ notmuch_thread_get_thread_id (notmuch_thread_t *thread);
int
notmuch_thread_get_total_messages (notmuch_thread_t *thread);
+/* Get a notmuch_messages_t iterator for the top-level messages in
+ * 'thread'.
+ *
+ * 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.
+ *
+ * To iterate over all messages in the thread, the caller will need to
+ * iterate over the result of notmuch_message_get_replies for each
+ * top-level message (and do that recursively for the resulting
+ * messages, etc.).
+ */
+notmuch_messages_t *
+notmuch_thread_get_toplevel_messages (notmuch_thread_t *thread);
+
/* Get the number of messages in 'thread' that matched the search.
*
* This count includes only the messages in this thread that were
@@ -639,6 +654,26 @@ notmuch_message_get_message_id (notmuch_message_t *message);
const char *
notmuch_message_get_thread_id (notmuch_message_t *message);
+/* Get a notmuch_messages_t iterator for all of the replies to
+ * 'message'.
+ *
+ * Note: This call only makes sense if 'message' was ultimately
+ * obtained from a notmuch_thread_t object, (such as by coming
+ * directly from the result of calling notmuch_thread_get_
+ * toplevel_messages or by any number of subsequent
+ * calls to notmuch_message_get_replies).
+ *
+ * If 'message' was obtained through some non-thread means, (such as
+ * by a call to notmuch_query_search_messages), then this function
+ * will return NULL.
+ *
+ * If there are no replies to 'message', this function will return
+ * NULL. (Note that notmuch_messages_has_more will accept that NULL
+ * value as legitimate, and simply return FALSE for it.)
+ */
+notmuch_messages_t *
+notmuch_message_get_replies (notmuch_message_t *message);
+
/* Get the filename for the email corresponding to 'message'.
*
* The returned filename is an absolute filename, (the initial