Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id A253940D155 for ; Sun, 31 Oct 2010 14:48:19 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -1.9 X-Spam-Level: X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5 tests=[BAYES_00=-1.9] autolearn=unavailable Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id uzWl4opWrFkb for ; Sun, 31 Oct 2010 14:48:02 -0700 (PDT) Received: from smtp.nextra.cz (smtp.nextra.cz [212.65.193.3]) by olra.theworths.org (Postfix) with ESMTP id 554C94196F2 for ; Sun, 31 Oct 2010 14:48:02 -0700 (PDT) Received: from resox.2x.cz (unknown [213.29.198.144]) by smtp.nextra.cz (Postfix) with ESMTP id 342B388CDB; Sun, 31 Oct 2010 22:30:06 +0100 (CET) Received: from wsh by resox.2x.cz with local (Exim 4.72) (envelope-from ) id 1PCfTP-0004wN-UJ; Sun, 31 Oct 2010 22:29:56 +0100 From: Michal Sojka To: notmuch@notmuchmail.org Subject: [PATCH v4 1/4] lib: Return added message even if it already was in the database Date: Sun, 31 Oct 2010 22:29:15 +0100 Message-Id: <1288560558-18915-2-git-send-email-sojkam1@fel.cvut.cz> X-Mailer: git-send-email 1.7.1 In-Reply-To: <87tyk3vpxd.fsf@wsheee.2x.cz> References: <87tyk3vpxd.fsf@wsheee.2x.cz> X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 Oct 2010 21:48:19 -0000 --- 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 e4ac970..9a4f715 100644 --- a/lib/database.cc +++ b/lib/database.cc @@ -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); diff --git a/lib/notmuch.h b/lib/notmuch.h index bd0880f..61c68d6 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