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 C167740D148 for ; Wed, 13 Oct 2010 05:14:24 -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=ham 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 S8qUl8hVZCuz for ; Wed, 13 Oct 2010 05:14:12 -0700 (PDT) Received: from max.feld.cvut.cz (max.feld.cvut.cz [147.32.192.36]) by olra.theworths.org (Postfix) with ESMTP id 10CD340D144 for ; Wed, 13 Oct 2010 05:14:12 -0700 (PDT) Received: from localhost (unknown [192.168.200.4]) by max.feld.cvut.cz (Postfix) with ESMTP id 44F9B19F33E1; Wed, 13 Oct 2010 14:14:11 +0200 (CEST) X-Virus-Scanned: IMAP AMAVIS Received: from max.feld.cvut.cz ([192.168.200.1]) by localhost (styx.feld.cvut.cz [192.168.200.4]) (amavisd-new, port 10044) with ESMTP id Neeq4+cg3LpK; Wed, 13 Oct 2010 14:14:09 +0200 (CEST) Received: from imap.feld.cvut.cz (imap.feld.cvut.cz [147.32.192.34]) by max.feld.cvut.cz (Postfix) with ESMTP id DD56219F33D8; Wed, 13 Oct 2010 14:14:09 +0200 (CEST) Received: from steelpick.2x.cz (note-sojka.felk.cvut.cz [147.32.86.30]) (Authenticated sender: sojkam1) by imap.feld.cvut.cz (Postfix) with ESMTPSA id D9FF515C086; Wed, 13 Oct 2010 14:14:09 +0200 (CEST) Received: from wsh by steelpick.2x.cz with local (Exim 4.72) (envelope-from ) id 1P60Dg-0005VJ-K8; Wed, 13 Oct 2010 14:14:08 +0200 From: Michal Sojka To: notmuch@notmuchmail.org Subject: [PATCH 1/4] lib: Return added message even if it already was in the database Date: Wed, 13 Oct 2010 14:13:55 +0200 Message-Id: <1286972038-21064-2-git-send-email-sojkam1@fel.cvut.cz> X-Mailer: git-send-email 1.7.1.3.g75e44 In-Reply-To: <1286972038-21064-1-git-send-email-sojkam1@fel.cvut.cz> References: <1286972038-21064-1-git-send-email-sojkam1@fel.cvut.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: Wed, 13 Oct 2010 12:14:25 -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 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.3.g75e44