1 Return-Path: <stebalien@gmail.com>
\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 arlo.cworth.org (Postfix) with ESMTP id BF51A6DE1343
\r
6 for <notmuch@notmuchmail.org>; Sat, 7 Nov 2015 13:04:45 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at cworth.org
\r
11 X-Spam-Status: No, score=-0.681 tagged_above=-999 required=5
\r
12 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001,
\r
13 RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001,
\r
14 T_FREEMAIL_FORGED_FROMDOMAIN=0.01,
\r
15 T_HEADER_FROM_DIFFERENT_DOMAINS=0.01] autolearn=disabled
\r
16 Received: from arlo.cworth.org ([127.0.0.1])
\r
17 by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)
\r
18 with ESMTP id 6sxUEwiSP0kr for <notmuch@notmuchmail.org>;
\r
19 Sat, 7 Nov 2015 13:04:43 -0800 (PST)
\r
20 Received: from mail-vk0-f43.google.com (mail-vk0-f43.google.com
\r
22 by arlo.cworth.org (Postfix) with ESMTPS id 50E416DE1006
\r
23 for <notmuch@notmuchmail.org>; Sat, 7 Nov 2015 13:04:43 -0800 (PST)
\r
24 Received: by vkfw189 with SMTP id w189so35685790vkf.2
\r
25 for <notmuch@notmuchmail.org>; Sat, 07 Nov 2015 13:04:42 -0800 (PST)
\r
26 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
\r
27 h=sender:from:to:cc:subject:date:message-id:in-reply-to:references;
\r
28 bh=XV38gCwswr3Z1qNgGfbC4k+fxluRzPJLD3DfyH7mRIw=;
\r
29 b=XJTxmSgg0uCOlFszvI2l6Ga5IIgO2L5Hb4mLs/4oz/Qd9QzwSCAgP0dgr85ge23o+D
\r
30 Uh38VIBLjapkGx2DV+zQK9x9ImF9isQhUkYos4SOtU4Jk8jJ+i17kUOfNYlAKV/LBETg
\r
31 4Sb9U3m4jNsdH7xjXI+My6ppXA2bXcquusXrEw8cOAKW4SUP8EQzIvo207jIQPV8KJRq
\r
32 JCkk2r8wojxVCxZmMW221uWT7a4IZ3yA6v8oJLP7CAReit7QrvO07cYYrxtvVqgRp7Iw
\r
33 IjhbfOx9bw4zo8zaLP7VCzwgsLQtHzMxbd+gVAwB1+5Zdye842xnUiOskEcefkonKirv
\r
35 X-Received: by 10.31.160.5 with SMTP id j5mr22470137vke.107.1446930282057;
\r
36 Sat, 07 Nov 2015 13:04:42 -0800 (PST)
\r
37 Received: from localhost ([50.247.245.235])
\r
38 by smtp.gmail.com with ESMTPSA id k7sm5632937vki.8.2015.11.07.13.04.41
\r
39 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
\r
40 Sat, 07 Nov 2015 13:04:41 -0800 (PST)
\r
41 Sender: Steven <stebalien@gmail.com>
\r
42 From: Steven Allen <steven@stebalien.com>
\r
43 To: notmuch@notmuchmail.org
\r
44 Cc: Steven Allen <steven@stebalien.com>
\r
45 Subject: [PATCH] Add a method to reparent threads to the database.
\r
46 Date: Sat, 7 Nov 2015 16:04:29 -0500
\r
47 Message-Id: <1446930269-4865-1-git-send-email-steven@stebalien.com>
\r
48 X-Mailer: git-send-email 2.6.2
\r
49 In-Reply-To: <1446408428-7703-1-git-send-email-steven@stebalien.com>
\r
50 References: <1446408428-7703-1-git-send-email-steven@stebalien.com>
\r
51 X-BeenThere: notmuch@notmuchmail.org
\r
52 X-Mailman-Version: 2.1.20
\r
54 List-Id: "Use and development of the notmuch mail system."
\r
55 <notmuch.notmuchmail.org>
\r
56 List-Unsubscribe: <https://notmuchmail.org/mailman/options/notmuch>,
\r
57 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
58 List-Archive: <http://notmuchmail.org/pipermail/notmuch/>
\r
59 List-Post: <mailto:notmuch@notmuchmail.org>
\r
60 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
61 List-Subscribe: <https://notmuchmail.org/mailman/listinfo/notmuch>,
\r
62 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
63 X-List-Received-Date: Sat, 07 Nov 2015 21:04:45 -0000
\r
65 This allows threads yielded from a query to outlive the query.
\r
67 lib/notmuch.h | 11 +++++++++++
\r
68 lib/thread.cc | 6 ++++++
\r
69 2 files changed, 17 insertions(+)
\r
71 diff --git a/lib/notmuch.h b/lib/notmuch.h
\r
72 index 310a8b8..9a2869b 100644
\r
75 @@ -1188,6 +1188,17 @@ notmuch_tags_t *
\r
76 notmuch_thread_get_tags (notmuch_thread_t *thread);
\r
79 + * Reparent a notmuch_thread_t object onto the database.
\r
81 + * Calling this function allows a notmuch_thread_t object to outlive its
\r
82 + * query. The query will automatically be reclaimed when the database is
\r
83 + * destroyed but if you want to free its memory before then, you should call
\r
84 + * notmuch_thread_destroy.
\r
87 +notmuch_thread_own (notmuch_thread_t *thread);
\r
90 * Destroy a notmuch_thread_t object.
\r
93 diff --git a/lib/thread.cc b/lib/thread.cc
\r
94 index 0c937d7..06fa155 100644
\r
97 @@ -623,3 +623,9 @@ notmuch_thread_destroy (notmuch_thread_t *thread)
\r
99 talloc_free (thread);
\r
103 +notmuch_thread_own (notmuch_thread_t *thread)
\r
105 + talloc_steal (thread->notmuch, thread);
\r