]> git.notmuchmail.org Git - notmuch/blobdiff - lib/message.cc
lib: add private function to extract the database for a message.
[notmuch] / lib / message.cc
index bacb4d46a0c1aa336a91e3b76b65097b1b1884c5..b84e5e1c8895deae3d7c88d62e3235341120053b 100644 (file)
@@ -283,7 +283,7 @@ _notmuch_message_get_term (notmuch_message_t *message,
     if (i == end)
        return NULL;
 
-    std::string term = *i;
+    const std::string &term = *i;
     if (strncmp (term.c_str(), prefix, prefix_len))
        return NULL;
 
@@ -641,7 +641,7 @@ _notmuch_message_add_directory_terms (void *ctx, notmuch_message_t *message)
        unsigned int directory_id;
        const char *direntry, *directory;
        char *colon;
-       const std::string term = *i;
+       const std::string &term = *i;
 
        /* Terminate loop at first term without desired prefix. */
        if (strncmp (term.c_str (), direntry_prefix, direntry_prefix_len))
@@ -1626,3 +1626,9 @@ notmuch_message_destroy (notmuch_message_t *message)
 {
     talloc_free (message);
 }
+
+notmuch_database_t *
+_notmuch_message_database (notmuch_message_t *message)
+{
+    return message->notmuch;
+}