1 Return-Path: <wsh@resox.2x.cz>
\r
2 X-Original-To: notmuch@notmuchmail.org
\r
3 Delivered-To: notmuch@notmuchmail.org
\r
4 Received: from localhost (localhost [127.0.0.1])
\r
5 by olra.theworths.org (Postfix) with ESMTP id A253940D155
\r
6 for <notmuch@notmuchmail.org>; Sun, 31 Oct 2010 14:48:19 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5
\r
12 tests=[BAYES_00=-1.9] autolearn=unavailable
\r
13 Received: from olra.theworths.org ([127.0.0.1])
\r
14 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
15 with ESMTP id uzWl4opWrFkb for <notmuch@notmuchmail.org>;
\r
16 Sun, 31 Oct 2010 14:48:02 -0700 (PDT)
\r
17 Received: from smtp.nextra.cz (smtp.nextra.cz [212.65.193.3])
\r
18 by olra.theworths.org (Postfix) with ESMTP id 554C94196F2
\r
19 for <notmuch@notmuchmail.org>; Sun, 31 Oct 2010 14:48:02 -0700 (PDT)
\r
20 Received: from resox.2x.cz (unknown [213.29.198.144])
\r
21 by smtp.nextra.cz (Postfix) with ESMTP id 342B388CDB;
\r
22 Sun, 31 Oct 2010 22:30:06 +0100 (CET)
\r
23 Received: from wsh by resox.2x.cz with local (Exim 4.72)
\r
24 (envelope-from <wsh@resox.2x.cz>)
\r
25 id 1PCfTP-0004wN-UJ; Sun, 31 Oct 2010 22:29:56 +0100
\r
26 From: Michal Sojka <sojkam1@fel.cvut.cz>
\r
27 To: notmuch@notmuchmail.org
\r
28 Subject: [PATCH v4 1/4] lib: Return added message even if it already was in
\r
30 Date: Sun, 31 Oct 2010 22:29:15 +0100
\r
31 Message-Id: <1288560558-18915-2-git-send-email-sojkam1@fel.cvut.cz>
\r
32 X-Mailer: git-send-email 1.7.1
\r
33 In-Reply-To: <87tyk3vpxd.fsf@wsheee.2x.cz>
\r
34 References: <87tyk3vpxd.fsf@wsheee.2x.cz>
\r
35 X-BeenThere: notmuch@notmuchmail.org
\r
36 X-Mailman-Version: 2.1.13
\r
38 List-Id: "Use and development of the notmuch mail system."
\r
39 <notmuch.notmuchmail.org>
\r
40 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
41 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
42 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
43 List-Post: <mailto:notmuch@notmuchmail.org>
\r
44 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
45 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
46 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
47 X-List-Received-Date: Sun, 31 Oct 2010 21:48:19 -0000
\r
50 lib/database.cc | 3 ++-
\r
51 lib/notmuch.h | 3 ++-
\r
52 2 files changed, 4 insertions(+), 2 deletions(-)
\r
54 diff --git a/lib/database.cc b/lib/database.cc
\r
55 index e4ac970..9a4f715 100644
\r
56 --- a/lib/database.cc
\r
57 +++ b/lib/database.cc
\r
58 @@ -1671,7 +1671,8 @@ notmuch_database_add_message (notmuch_database_t *notmuch,
\r
62 - if (ret == NOTMUCH_STATUS_SUCCESS && message_ret)
\r
63 + if ((ret == NOTMUCH_STATUS_SUCCESS ||
\r
64 + ret == NOTMUCH_STATUS_DUPLICATE_MESSAGE_ID) && message_ret)
\r
65 *message_ret = message;
\r
67 notmuch_message_destroy (message);
\r
68 diff --git a/lib/notmuch.h b/lib/notmuch.h
\r
69 index bd0880f..61c68d6 100644
\r
72 @@ -238,7 +238,8 @@ notmuch_database_get_directory (notmuch_database_t *database,
\r
73 * notmuch database will reference the filename, and will not copy the
\r
74 * entire contents of the file.
\r
76 - * If 'message' is not NULL, then, on successful return '*message'
\r
77 + * If 'message' is not NULL, then, on successful return
\r
78 + * (NOTMUCH_STATUS_SUCCESS or NOTMUCH_STATUS_DUPLICATE_MESSAGE_ID) '*message'
\r
79 * will be initialized to a message object that can be used for things
\r
80 * such as adding tags to the just-added message. The user should call
\r
81 * notmuch_message_destroy when done with the message. On any failure
\r