aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
authorGravatar Carl Worth <cworth@cworth.org>2009-11-15 20:36:51 -0800
committerGravatar Carl Worth <cworth@cworth.org>2009-11-15 20:36:51 -0800
commitd136a1e2cffe954d83495c0f8e45d5ce97583e90 (patch)
tree3c13d14609a27c054bf29d8e226f884222a60a5a /lib
parentb97756926f3bb9f940e8d6a9724c02a29f40f128 (diff)
Add _notmuch_message_get_in_reply_to.
The existing notmuch_message_get_header is *almost* good enough for this, except that we also need to remove the '<' and '>' delimiters. We'll probably want to implement this function with database storage in the future rather than loading the email message.
Diffstat (limited to 'lib')
-rw-r--r--lib/message.cc12
-rw-r--r--lib/notmuch-private.h3
2 files changed, 15 insertions, 0 deletions
diff --git a/lib/message.cc b/lib/message.cc
index 28f19a88..b9f998c5 100644
--- a/lib/message.cc
+++ b/lib/message.cc
@@ -259,6 +259,18 @@ notmuch_message_get_header (notmuch_message_t *message, const char *header)
return notmuch_message_file_get_header (message->message_file, header);
}
+/* XXX: We probably want to store the In-Reply-To header in the
+ * database (separate from the References message IDs) so that we can
+ * fetch it out again without having to go load the message file. */
+const char *
+_notmuch_message_get_in_reply_to (notmuch_message_t *message)
+{
+ return _parse_message_id (message,
+ notmuch_message_get_header (message,
+ "in-reply-to"),
+ NULL);
+}
+
const char *
notmuch_message_get_thread_id (notmuch_message_t *message)
{
diff --git a/lib/notmuch-private.h b/lib/notmuch-private.h
index 74edf242..c4b66395 100644
--- a/lib/notmuch-private.h
+++ b/lib/notmuch-private.h
@@ -172,6 +172,9 @@ _notmuch_message_create_for_message_id (const void *talloc_owner,
const char *message_id,
notmuch_private_status_t *status);
+const char *
+_notmuch_message_get_in_reply_to (notmuch_message_t *message);
+
notmuch_private_status_t
_notmuch_message_add_term (notmuch_message_t *message,
const char *prefix_name,