- /* Get thread */
- if (!message->thread_id)
- message->thread_id =
- _notmuch_message_get_term (message, i, end, thread_prefix);
-
- /* Get tags */
- assert (strcmp (thread_prefix, tag_prefix) < 0);
- if (!message->tag_list) {
- message->tag_list =
- _notmuch_database_get_terms_with_prefix (message, i, end,
- tag_prefix);
- _notmuch_string_list_sort (message->tag_list);
- }
+ /* Get filename list. Here we get only the terms. We lazily
+ * expand them to full file names when needed in
+ * _notmuch_message_ensure_filename_list. */
+ assert (strcmp (type_prefix, filename_prefix) < 0);
+ if (!message->filename_term_list && !message->filename_list)
+ message->filename_term_list =
+ _notmuch_database_get_terms_with_prefix (message, i, end,
+ filename_prefix);
+
+
+ /* Get property terms. Mimic the setup with filenames above */
+ assert (strcmp (filename_prefix, property_prefix) < 0);
+ if (!message->property_map && !message->property_term_list)
+ message->property_term_list =
+ _notmuch_database_get_terms_with_prefix (message, i, end,
+ property_prefix);
+
+ /* Get reply to */
+ assert (strcmp (property_prefix, replyto_prefix) < 0);
+ if (!message->in_reply_to)
+ message->in_reply_to =
+ _notmuch_message_get_term (message, i, end, replyto_prefix);