From: Michal Sojka Date: Sun, 31 Oct 2010 21:29:15 +0000 (+0100) Subject: lib: Return added message even if it already was in the database X-Git-Tag: 0.5~48 X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=commitdiff_plain;h=b65a783195cb459a316370eb7a956b6029102f2e lib: Return added message even if it already was in the database --- diff --git a/lib/database.cc b/lib/database.cc index 82c07886..7a00917e 100644 --- a/lib/database.cc +++ b/lib/database.cc @@ -1670,7 +1670,8 @@ notmuch_database_add_message (notmuch_database_t *notmuch, DONE: if (message) { - if (ret == NOTMUCH_STATUS_SUCCESS && message_ret) + if ((ret == NOTMUCH_STATUS_SUCCESS || + ret == NOTMUCH_STATUS_DUPLICATE_MESSAGE_ID) && message_ret) *message_ret = message; else notmuch_message_destroy (message); diff --git a/lib/notmuch.h b/lib/notmuch.h index bd0880f3..61c68d65 100644 --- a/lib/notmuch.h +++ b/lib/notmuch.h @@ -238,7 +238,8 @@ notmuch_database_get_directory (notmuch_database_t *database, * notmuch database will reference the filename, and will not copy the * entire contents of the file. * - * If 'message' is not NULL, then, on successful return '*message' + * If 'message' is not NULL, then, on successful return + * (NOTMUCH_STATUS_SUCCESS or NOTMUCH_STATUS_DUPLICATE_MESSAGE_ID) '*message' * will be initialized to a message object that can be used for things * such as adding tags to the just-added message. The user should call * notmuch_message_destroy when done with the message. On any failure