summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
8a1eeec)
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.
const char *charset;
if (! part) {
const char *charset;
if (! part) {
- _notmuch_database_log (_notmuch_message_database (message),
+ _notmuch_database_log (notmuch_message_get_database (message),
"Warning: Not indexing empty mime part.\n");
return;
}
"Warning: Not indexing empty mime part.\n");
return;
}
g_mime_multipart_get_part (multipart, i));
continue;
} else if (i != GMIME_MULTIPART_SIGNED_CONTENT) {
g_mime_multipart_get_part (multipart, i));
continue;
} else if (i != GMIME_MULTIPART_SIGNED_CONTENT) {
- _notmuch_database_log (_notmuch_message_database (message),
+ _notmuch_database_log (notmuch_message_get_database (message),
"Warning: Unexpected extra parts of multipart/signed. Indexing anyway.\n");
}
}
"Warning: Unexpected extra parts of multipart/signed. Indexing anyway.\n");
}
}
GMIME_MULTIPART_ENCRYPTED (part));
} else {
if (i != GMIME_MULTIPART_ENCRYPTED_VERSION) {
GMIME_MULTIPART_ENCRYPTED (part));
} else {
if (i != GMIME_MULTIPART_ENCRYPTED_VERSION) {
- _notmuch_database_log (_notmuch_message_database (message),
+ _notmuch_database_log (notmuch_message_get_database (message),
"Warning: Unexpected extra parts of multipart/encrypted.\n");
}
}
"Warning: Unexpected extra parts of multipart/encrypted.\n");
}
}
}
if (! (GMIME_IS_PART (part))) {
}
if (! (GMIME_IS_PART (part))) {
- _notmuch_database_log (_notmuch_message_database (message),
+ _notmuch_database_log (notmuch_message_get_database (message),
"Warning: Not indexing unknown mime part: %s.\n",
g_type_name (G_OBJECT_TYPE (part)));
return;
"Warning: Not indexing unknown mime part: %s.\n",
g_type_name (G_OBJECT_TYPE (part)));
return;
if (!indexopts || (notmuch_indexopts_get_decrypt_policy (indexopts) == NOTMUCH_DECRYPT_FALSE))
return;
if (!indexopts || (notmuch_indexopts_get_decrypt_policy (indexopts) == NOTMUCH_DECRYPT_FALSE))
return;
- notmuch = _notmuch_message_database (message);
+ notmuch = notmuch_message_get_database (message);
GMimeCryptoContext* crypto_ctx = NULL;
#if (GMIME_MAJOR_VERSION < 3)
GMimeCryptoContext* crypto_ctx = NULL;
#if (GMIME_MAJOR_VERSION < 3)
notmuch_status_t status;
char *term = NULL;
notmuch_status_t status;
char *term = NULL;
- status = _notmuch_database_ensure_writable (_notmuch_message_database (message));
+ status = _notmuch_database_ensure_writable (notmuch_message_get_database (message));
if (status)
return status;
if (status)
return status;
notmuch_status_t status;
const char * term_prefix;
notmuch_status_t status;
const char * term_prefix;
- status = _notmuch_database_ensure_writable (_notmuch_message_database (message));
+ status = _notmuch_database_ensure_writable (notmuch_message_get_database (message));
if (status)
return status;
if (status)
return status;
doc_id = _notmuch_database_generate_doc_id (notmuch);
} catch (const Xapian::Error &error) {
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;
error.get_msg().c_str());
notmuch->exception_reported = true;
*status_ret = NOTMUCH_PRIVATE_STATUS_XAPIAN_EXCEPTION;
return;
message->message_file = _notmuch_message_file_open_ctx (
return;
message->message_file = _notmuch_message_file_open_ctx (
- _notmuch_message_database (message), message, filename);
+ notmuch_message_get_database (message), message, filename);
return talloc_strdup (message, value.c_str ());
} catch (Xapian::Error &error) {
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;
error.get_msg().c_str());
message->notmuch->exception_reported = true;
return NULL;
notmuch_database_t *notmuch = message->notmuch;
if (!notmuch->exception_reported) {
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;
}
error.get_msg().c_str());
notmuch->exception_reported = true;
}
try {
value = message->doc.get_value (NOTMUCH_VALUE_TIMESTAMP);
} catch (Xapian::Error &error) {
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;
error.get_msg().c_str());
message->notmuch->exception_reported = true;
return 0;
-_notmuch_message_database (notmuch_message_t *message)
+notmuch_message_get_database (notmuch_message_t *message)
{
return message->notmuch;
}
{
return message->notmuch;
}
/* strdup it because the metadata may be invalidated */
orig_thread_id = talloc_strdup (message, orig_thread_id);
/* 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)
ret = _notmuch_database_ensure_writable (notmuch);
if (ret)
void
_notmuch_message_add_reply (notmuch_message_t *message,
notmuch_message_t *reply);
void
_notmuch_message_add_reply (notmuch_message_t *message,
notmuch_message_t *reply);
-notmuch_database_t *
-_notmuch_message_database (notmuch_message_t *message);
void
_notmuch_message_remove_unprefixed_terms (notmuch_message_t *message);
void
_notmuch_message_remove_unprefixed_terms (notmuch_message_t *message);
notmuch_tags_t *
notmuch_messages_collect_tags (notmuch_messages_t *messages);
notmuch_tags_t *
notmuch_messages_collect_tags (notmuch_messages_t *messages);
+/**
+ * Get the database associated with this message.
+ *
+ * @since libnotmuch 5.2 (notmuch 0.27)
+ */
+notmuch_database_t *
+notmuch_message_get_database (notmuch_message_t *message);
+
/**
* Get the message ID of 'message'.
*
/**
* Get the message ID of 'message'.
*