aboutsummaryrefslogtreecommitdiff
path: root/lib/message.cc
diff options
context:
space:
mode:
authorDaniel Kahn Gillmor <dkg@fifthhorseman.net>2018-05-11 02:57:52 -0400
committerDavid Bremner <david@tethera.net>2018-05-26 07:30:32 -0700
commit9088db76d89264b733f6b45e776d8952da237921 (patch)
tree42d9930598b27ab082da4502116f243a8c42861f /lib/message.cc
parent8a1eeecdfe83a5ca0a923e5d1e31bff076e406ce (diff)
lib: expose notmuch_message_get_database()
We've had _notmuch_message_database() internally for a while, and it's useful. It turns out to be useful on the other side of the library interface as well (i'll use it later in this series for "notmuch show"), so we expose it publicly now.
Diffstat (limited to 'lib/message.cc')
-rw-r--r--lib/message.cc14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/message.cc b/lib/message.cc
index b2067076..a7e8c3ca 100644
--- a/lib/message.cc
+++ b/lib/message.cc
@@ -268,7 +268,7 @@ _notmuch_message_create_for_message_id (notmuch_database_t *notmuch,
doc_id = _notmuch_database_generate_doc_id (notmuch);
} catch (const Xapian::Error &error) {
- _notmuch_database_log(_notmuch_message_database (message), "A Xapian exception occurred creating message: %s\n",
+ _notmuch_database_log(notmuch_message_get_database (message), "A Xapian exception occurred creating message: %s\n",
error.get_msg().c_str());
notmuch->exception_reported = true;
*status_ret = NOTMUCH_PRIVATE_STATUS_XAPIAN_EXCEPTION;
@@ -512,7 +512,7 @@ _notmuch_message_ensure_message_file (notmuch_message_t *message)
return;
message->message_file = _notmuch_message_file_open_ctx (
- _notmuch_message_database (message), message, filename);
+ notmuch_message_get_database (message), message, filename);
}
const char *
@@ -542,7 +542,7 @@ notmuch_message_get_header (notmuch_message_t *message, const char *header)
return talloc_strdup (message, value.c_str ());
} catch (Xapian::Error &error) {
- _notmuch_database_log(_notmuch_message_database (message), "A Xapian exception occurred when reading header: %s\n",
+ _notmuch_database_log(notmuch_message_get_database (message), "A Xapian exception occurred when reading header: %s\n",
error.get_msg().c_str());
message->notmuch->exception_reported = true;
return NULL;
@@ -663,7 +663,7 @@ _notmuch_message_remove_indexed_terms (notmuch_message_t *message)
notmuch_database_t *notmuch = message->notmuch;
if (!notmuch->exception_reported) {
- _notmuch_database_log(_notmuch_message_database (message), "A Xapian exception occurred creating message: %s\n",
+ _notmuch_database_log(notmuch_message_get_database (message), "A Xapian exception occurred creating message: %s\n",
error.get_msg().c_str());
notmuch->exception_reported = true;
}
@@ -1059,7 +1059,7 @@ notmuch_message_get_date (notmuch_message_t *message)
try {
value = message->doc.get_value (NOTMUCH_VALUE_TIMESTAMP);
} catch (Xapian::Error &error) {
- _notmuch_database_log(_notmuch_message_database (message), "A Xapian exception occurred when reading date: %s\n",
+ _notmuch_database_log(notmuch_message_get_database (message), "A Xapian exception occurred when reading date: %s\n",
error.get_msg().c_str());
message->notmuch->exception_reported = true;
return 0;
@@ -1925,7 +1925,7 @@ notmuch_message_destroy (notmuch_message_t *message)
}
notmuch_database_t *
-_notmuch_message_database (notmuch_message_t *message)
+notmuch_message_get_database (notmuch_message_t *message)
{
return message->notmuch;
}
@@ -2002,7 +2002,7 @@ notmuch_message_reindex (notmuch_message_t *message,
/* strdup it because the metadata may be invalidated */
orig_thread_id = talloc_strdup (message, orig_thread_id);
- notmuch = _notmuch_message_database (message);
+ notmuch = notmuch_message_get_database (message);
ret = _notmuch_database_ensure_writable (notmuch);
if (ret)