]> rtime.felk.cvut.cz Git - notmuch.git/commitdiff
lib: Return added message even if it already was in the database
authorMichal Sojka <sojkam1@fel.cvut.cz>
Tue, 4 May 2010 08:53:19 +0000 (10:53 +0200)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Sun, 31 Oct 2010 11:43:34 +0000 (12:43 +0100)
lib/database.cc
lib/notmuch.h

index e4ac970f4bc597398750a60ca0988e59c6c700c1..9a4f71576a094c9ff90b5d850115de7d52b4ca82 100644 (file)
@@ -1671,7 +1671,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);
index bd0880f3a232df162e90db66daac6b70e0f47394..61c68d65df151f084a878da44335fe82f169bcaf 100644 (file)
@@ -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