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 5786B418C34 for ; Tue, 11 May 2010 05:14:47 -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 OKjKy5wKx9tu for ; Tue, 11 May 2010 05:14:34 -0700 (PDT) Received: from max.feld.cvut.cz (max.feld.cvut.cz [147.32.192.36]) by olra.theworths.org (Postfix) with ESMTP id E1F174196F2 for ; Tue, 11 May 2010 05:14:33 -0700 (PDT) Received: from localhost (unknown [192.168.200.4]) by max.feld.cvut.cz (Postfix) with ESMTP id 87BCF19F3411; Tue, 11 May 2010 14:14:32 +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 mnhg+Tkzpivj; Tue, 11 May 2010 14:14:31 +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 3E24119F33FC; Tue, 11 May 2010 14:14:31 +0200 (CEST) Received: from steelpick.2x.cz (k335-30.felk.cvut.cz [147.32.86.30]) (Authenticated sender: sojkam1) by imap.feld.cvut.cz (Postfix) with ESMTPSA id 380CFFA004; Tue, 11 May 2010 14:14:31 +0200 (CEST) Received: from wsh by steelpick.2x.cz with local (Exim 4.71) (envelope-from ) id 1OBoM3-0005sq-1a; Tue, 11 May 2010 14:14:31 +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: Tue, 11 May 2010 14:14:18 +0200 Message-Id: <1273580061-22580-2-git-send-email-sojkam1@fel.cvut.cz> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1273580061-22580-1-git-send-email-sojkam1@fel.cvut.cz> References: <1273580061-22580-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: Tue, 11 May 2010 12:14:47 -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 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