unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Michal Sojka <sojkam1@fel.cvut.cz>
To: notmuch@notmuchmail.org
Subject: [PATCH 1/4] lib: Return added message even if it already was in the database
Date: Tue, 11 May 2010 14:14:18 +0200	[thread overview]
Message-ID: <1273580061-22580-2-git-send-email-sojkam1@fel.cvut.cz> (raw)
In-Reply-To: <1273580061-22580-1-git-send-email-sojkam1@fel.cvut.cz>

---
 lib/database.cc |    3 ++-
 lib/notmuch.h   |    3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/lib/database.cc b/lib/database.cc
index 6afc8d9..694b7ec 100644
--- a/lib/database.cc
+++ b/lib/database.cc
@@ -1613,7 +1613,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 505ad19..0ba1416 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
-- 
1.7.1

  reply	other threads:[~2010-05-11 12:14 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-11 12:14 [PATCH 0/4] Maildir synchronization Michal Sojka
2010-05-11 12:14 ` Michal Sojka [this message]
2010-05-11 12:14 ` [PATCH 2/4] " Michal Sojka
2010-05-11 12:14 ` [PATCH 3/4] Make maildir synchronization configurable Michal Sojka
2010-05-11 12:14 ` [PATCH 4/4] Tests for maildir synchronization Michal Sojka
2010-06-09 18:52 ` [PATCH 0/4] Maildir synchronization Matt Fleming
2010-06-10  3:01   ` Dirk Hohndel
2010-06-10  4:59     ` Michal Sojka
2010-10-30  0:13       ` Carl Worth
2010-10-30 12:13         ` Michal Sojka
2010-10-31 21:29           ` [PATCH v4 " Michal Sojka
2010-11-04 19:16             ` Carl Worth
2010-11-07  1:46               ` Michal Sojka
2010-11-08 19:35                 ` Carl Worth
2010-11-09 10:06                   ` Michal Sojka
2010-11-09 20:38                     ` Carl Worth
2010-11-09 23:39                       ` Michal Sojka
2010-11-10  0:57                         ` Carl Worth
2010-11-10 10:26                           ` Michal Sojka
2010-11-10 10:27                             ` [PATCH] test: More maildir synchronization tests Michal Sojka
2010-11-10 16:48                             ` [PATCH v4 0/4] Maildir synchronization Carl Worth
2010-11-10 20:48                               ` Carl Worth
2010-11-11 15:51                                 ` Michal Sojka
2010-11-11 18:20                                   ` Carl Worth
2010-10-31 21:29           ` [PATCH v4 1/4] lib: Return added message even if it already was in the database Michal Sojka
2010-10-31 21:29           ` [PATCH v4 2/4] Maildir synchronization Michal Sojka
2010-10-31 21:29           ` [PATCH v4 3/4] Make maildir synchronization configurable Michal Sojka
2010-10-31 21:29           ` [PATCH v4 4/4] Tests for maildir synchronization Michal Sojka
2010-11-05  7:37     ` [PATCH 0/4] Maildir synchronization Sebastian Spaeth
2010-11-07 21:03       ` Michal Sojka
  -- strict thread matches above, loose matches on Subject: below --
2010-10-13 12:13 [PATCH 0/4] Maildir synchronization v2 Michal Sojka
2010-10-13 12:13 ` [PATCH 1/4] lib: Return added message even if it already was in the database Michal Sojka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1273580061-22580-2-git-send-email-sojkam1@fel.cvut.cz \
    --to=sojkam1@fel.cvut.cz \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).