1 Return-Path: <jrollins@finestructure.net>
\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 D4159431FCF
\r
6 for <notmuch@notmuchmail.org>; Sun, 19 Aug 2012 18:53:08 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-2.3 tagged_above=-999 required=5
\r
12 tests=[RCVD_IN_DNSWL_MED=-2.3] autolearn=disabled
\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 4wgZRT-EVDdG for <notmuch@notmuchmail.org>;
\r
16 Sun, 19 Aug 2012 18:53:06 -0700 (PDT)
\r
17 Received: from outgoing-mail.its.caltech.edu (outgoing-mail.its.caltech.edu
\r
19 by olra.theworths.org (Postfix) with ESMTP id B5FB2431FAE
\r
20 for <notmuch@notmuchmail.org>; Sun, 19 Aug 2012 18:53:06 -0700 (PDT)
\r
21 Received: from earth-doxen.imss.caltech.edu (localhost [127.0.0.1])
\r
22 by earth-doxen-postvirus (Postfix) with ESMTP id 57BE666E00DF
\r
23 for <notmuch@notmuchmail.org>; Sun, 19 Aug 2012 18:53:06 -0700 (PDT)
\r
24 X-Spam-Scanned: at Caltech-IMSS on earth-doxen by amavisd-new
\r
25 Received: from finestructure.net (unknown [76.89.192.57])
\r
26 (Authenticated sender: jrollins)
\r
27 by earth-doxen-submit (Postfix) with ESMTP id 516EF66E00DE
\r
28 for <notmuch@notmuchmail.org>; Sun, 19 Aug 2012 18:53:04 -0700 (PDT)
\r
29 Received: by finestructure.net (Postfix, from userid 1000)
\r
30 id D14928E6; Sun, 19 Aug 2012 18:53:03 -0700 (PDT)
\r
31 From: Jameson Graef Rollins <jrollins@finestructure.net>
\r
32 To: Notmuch Mail <notmuch@notmuchmail.org>
\r
33 Subject: [PATCH 04/11] lib: remove no longer needed author-specific thread
\r
35 Date: Sun, 19 Aug 2012 18:52:43 -0700
\r
36 Message-Id: <1345427570-26518-5-git-send-email-jrollins@finestructure.net>
\r
37 X-Mailer: git-send-email 1.7.10.4
\r
38 In-Reply-To: <1345427570-26518-4-git-send-email-jrollins@finestructure.net>
\r
39 References: <1345427570-26518-1-git-send-email-jrollins@finestructure.net>
\r
40 <1345427570-26518-2-git-send-email-jrollins@finestructure.net>
\r
41 <1345427570-26518-3-git-send-email-jrollins@finestructure.net>
\r
42 <1345427570-26518-4-git-send-email-jrollins@finestructure.net>
\r
43 X-BeenThere: notmuch@notmuchmail.org
\r
44 X-Mailman-Version: 2.1.13
\r
46 List-Id: "Use and development of the notmuch mail system."
\r
47 <notmuch.notmuchmail.org>
\r
48 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
49 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
50 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
51 List-Post: <mailto:notmuch@notmuchmail.org>
\r
52 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
53 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
54 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
55 X-List-Received-Date: Mon, 20 Aug 2012 01:53:09 -0000
\r
57 The _add_author, _add_matched_author, and
\r
58 _resolve_thread_authors_string functions have been replaced by the
\r
59 more generic _address functions that utilize the new
\r
60 notmuch_thread_addresses_t.
\r
62 lib/thread.cc | 91 ---------------------------------------------------------
\r
63 1 file changed, 91 deletions(-)
\r
65 diff --git a/lib/thread.cc b/lib/thread.cc
\r
66 index b53ccb0..757e143 100644
\r
69 @@ -143,97 +143,6 @@ _resolve_thread_addresses_string (notmuch_thread_addresses_t *addresses)
\r
73 -/* Add each author of the thread to the thread's authors_hash and to
\r
74 - * the thread's authors_array. */
\r
76 -_thread_add_author (notmuch_thread_t *thread,
\r
77 - const char *author)
\r
79 - char *author_copy;
\r
81 - if (author == NULL)
\r
84 - if (g_hash_table_lookup_extended (thread->authors_hash,
\r
85 - author, NULL, NULL))
\r
88 - author_copy = talloc_strdup (thread, author);
\r
90 - g_hash_table_insert (thread->authors_hash, author_copy, NULL);
\r
92 - g_ptr_array_add (thread->authors_array, author_copy);
\r
95 -/* Add each matched author of the thread to the thread's
\r
96 - * matched_authors_hash and to the thread's matched_authors_array. */
\r
98 -_thread_add_matched_author (notmuch_thread_t *thread,
\r
99 - const char *author)
\r
101 - char *author_copy;
\r
103 - if (author == NULL)
\r
106 - if (g_hash_table_lookup_extended (thread->matched_authors_hash,
\r
107 - author, NULL, NULL))
\r
110 - author_copy = talloc_strdup (thread, author);
\r
112 - g_hash_table_insert (thread->matched_authors_hash, author_copy, NULL);
\r
114 - g_ptr_array_add (thread->matched_authors_array, author_copy);
\r
117 -/* Construct an authors string from matched_authors_array and
\r
118 - * authors_array. The string contains matched authors first, then
\r
119 - * non-matched authors (with the two groups separated by '|'). Within
\r
120 - * each group, authors are listed in date order. */
\r
122 -_resolve_thread_authors_string (notmuch_thread_t *thread)
\r
126 - int first_non_matched_author = 1;
\r
128 - /* First, list all matched authors in date order. */
\r
129 - for (i = 0; i < thread->matched_authors_array->len; i++) {
\r
130 - author = (char *) g_ptr_array_index (thread->matched_authors_array, i);
\r
131 - if (thread->authors)
\r
132 - thread->authors = talloc_asprintf (thread, "%s, %s",
\r
136 - thread->authors = author;
\r
139 - /* Next, append any non-matched authors that haven't already appeared. */
\r
140 - for (i = 0; i < thread->authors_array->len; i++) {
\r
141 - author = (char *) g_ptr_array_index (thread->authors_array, i);
\r
142 - if (g_hash_table_lookup_extended (thread->matched_authors_hash,
\r
143 - author, NULL, NULL))
\r
145 - if (first_non_matched_author) {
\r
146 - thread->authors = talloc_asprintf (thread, "%s| %s",
\r
150 - thread->authors = talloc_asprintf (thread, "%s, %s",
\r
155 - first_non_matched_author = 0;
\r
158 - g_ptr_array_free (thread->authors_array, TRUE);
\r
159 - thread->authors_array = NULL;
\r
160 - g_ptr_array_free (thread->matched_authors_array, TRUE);
\r
161 - thread->matched_authors_array = NULL;
\r
164 /* clean up the ugly "Lastname, Firstname" format that some mail systems
\r
165 * (most notably, Exchange) are creating to be "Firstname Lastname"
\r
166 * To make sure that we don't change other potential situations where a
\r