X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=database.cc;h=71246eb456115ade91ee9b47b89629850ab32e11;hp=8d477eca069abb7e3d1619d5881d3b3ad8d44469;hb=07aa759b68f3198e565385eb23736984bb378d0f;hpb=854f82fb91ef9560259e4597d475747e948204d5 diff --git a/database.cc b/database.cc index 8d477eca..71246eb4 100644 --- a/database.cc +++ b/database.cc @@ -104,12 +104,12 @@ typedef struct { prefix_t BOOLEAN_PREFIX_INTERNAL[] = { { "type", "T" }, - { "thread", "G" }, { "ref", "XREFERENCE" }, { "timestamp", "XTIMESTAMP" }, }; prefix_t BOOLEAN_PREFIX_EXTERNAL[] = { + { "thread", "G" }, { "tag", "K" }, { "id", "Q" } }; @@ -489,6 +489,7 @@ notmuch_database_open (const char *path) } catch (const Xapian::Error &error) { fprintf (stderr, "A Xapian exception occurred: %s\n", error.get_msg().c_str()); + notmuch = NULL; } DONE: @@ -836,6 +837,9 @@ notmuch_database_add_message (notmuch_database_t *notmuch, const char *from, *to, *subject, *old_filename; char *message_id; + if (message_ret) + *message_ret = NULL; + message_file = notmuch_message_file_open (filename); if (message_file == NULL) { ret = NOTMUCH_STATUS_FILE_ERROR; @@ -932,7 +936,7 @@ notmuch_database_add_message (notmuch_database_t *notmuch, DONE: if (message) { - if (message_ret) + if (ret == NOTMUCH_STATUS_SUCCESS && message_ret) *message_ret = message; else notmuch_message_destroy (message);