RE: Reply all - issue
[notmuch-archives.git] / 89 / 3f73176959a5c6a8b97519fbd32ba8dc9c91a8
1 Return-Path: <ethan.glasser.camp@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 olra.theworths.org (Postfix) with ESMTP id C9A01431FAF\r
6         for <notmuch@notmuchmail.org>; Sun,  1 Jul 2012 09:45:40 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: 1.061\r
10 X-Spam-Level: *\r
11 X-Spam-Status: No, score=1.061 tagged_above=-999 required=5\r
12         tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
13         FREEMAIL_FROM=0.001, RCVD_IN_BL_SPAMCOP_NET=1.246,\r
14         RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_SORBS_WEB=0.614] autolearn=disabled\r
15 Received: from olra.theworths.org ([127.0.0.1])\r
16         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
17         with ESMTP id nyal8tMxthgW for <notmuch@notmuchmail.org>;\r
18         Sun,  1 Jul 2012 09:45:40 -0700 (PDT)\r
19 Received: from mail-wi0-f169.google.com (mail-wi0-f169.google.com\r
20         [209.85.212.169]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
21         (No client certificate requested)\r
22         by olra.theworths.org (Postfix) with ESMTPS id 0C076431FBC\r
23         for <notmuch@notmuchmail.org>; Sun,  1 Jul 2012 09:45:37 -0700 (PDT)\r
24 Received: by wibhm2 with SMTP id hm2so2251711wib.2\r
25         for <notmuch@notmuchmail.org>; Sun, 01 Jul 2012 09:45:36 -0700 (PDT)\r
26 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
27         h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references;\r
28         bh=HC9oKICFAU9pcKU4tGq9SgYD0TPlU+WfXGf3wVKoDTM=;\r
29         b=jBqCxiYjfqa2z7RAoNPkPau2QrRxYZmXhrggJGun6RzSASjmFy+u+G24Zkd+ScnKku\r
30         isKdnK4PRgE2SUwSbDBsl1deSjlbYrGdFKuYn/gnOFG5Aos9CnAPbv7z95ns5AantbTy\r
31         ouX19HaKE6ZlhcO++oV4vKUg9ohfJtbdD28MqgwCdwic9/cE2hb4Y75+ZdaNo6xLFZkm\r
32         qEOYbiBgnRjdY2VZ0uTezspHE4sJRMNdeGwMLJ+yRKnzrsEokFJN98VPzhHzdA0ip+Du\r
33         WeygZzXKdkEjLopelevRBrOtK5soaxCGf/sAMM7UJmslSWsJ118dtAQl+tF8sdo/hSf5\r
34         yPSg==\r
35 Received: by 10.216.150.140 with SMTP id z12mr446426wej.68.1341161136632;\r
36         Sun, 01 Jul 2012 09:45:36 -0700 (PDT)\r
37 Received: from localhost ([195.24.209.21])\r
38         by mx.google.com with ESMTPS id ch9sm35152621wib.8.2012.07.01.09.45.28\r
39         (version=TLSv1/SSLv3 cipher=OTHER);\r
40         Sun, 01 Jul 2012 09:45:35 -0700 (PDT)\r
41 From: Ethan Glasser-Camp <ethan.glasser.camp@gmail.com>\r
42 To: notmuch@notmuchmail.org\r
43 Subject: [PATCH v2 3/8] Not all filenames need to be converted to absolute\r
44         paths\r
45 Date: Sun,  1 Jul 2012 12:39:45 -0400\r
46 Message-Id: <1341160790-14525-4-git-send-email-ethan@betacantrips.com>\r
47 X-Mailer: git-send-email 1.7.9.5\r
48 In-Reply-To: <1341160790-14525-1-git-send-email-ethan@betacantrips.com>\r
49 References:\r
50  <CAOJ+Ob0MSOez2MvD2fCgF7t32kFPk4g2+xCud88QmBLt_b5pOA@mail.gmail.com>\r
51         <1341160790-14525-1-git-send-email-ethan@betacantrips.com>\r
52 Cc: Ethan Glasser-Camp <ethan@betacantrips.com>\r
53 X-BeenThere: notmuch@notmuchmail.org\r
54 X-Mailman-Version: 2.1.13\r
55 Precedence: list\r
56 List-Id: "Use and development of the notmuch mail system."\r
57         <notmuch.notmuchmail.org>\r
58 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
59         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
60 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
61 List-Post: <mailto:notmuch@notmuchmail.org>\r
62 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
63 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
64         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
65 X-List-Received-Date: Sun, 01 Jul 2012 16:45:41 -0000\r
66 \r
67 _notmuch_message_ensure_filename_list converts "relative" paths, such\r
68 as those stored in Xapian until now, to "absolute" paths. However,\r
69 URLs are already absolute, and prepending the database path will just\r
70 confuse matters.\r
71 \r
72 Signed-off-by: Ethan Glasser-Camp <ethan@betacantrips.com>\r
73 ---\r
74  lib/message.cc |   20 +++++++++++++++++---\r
75  1 file changed, 17 insertions(+), 3 deletions(-)\r
76 \r
77 diff --git a/lib/message.cc b/lib/message.cc\r
78 index 978de06..235185c 100644\r
79 --- a/lib/message.cc\r
80 +++ b/lib/message.cc\r
81 @@ -21,6 +21,7 @@\r
82  #include "notmuch-private.h"\r
83  #include "database-private.h"\r
84  \r
85 +#include <uriparser/Uri.h>\r
86  #include <stdint.h>\r
87  \r
88  #include <gmime/gmime.h>\r
89 @@ -682,6 +683,8 @@ _notmuch_message_ensure_filename_list (notmuch_message_t *message)\r
90         const char *db_path, *directory, *basename, *filename;\r
91         char *colon, *direntry = NULL;\r
92         unsigned int directory_id;\r
93 +       UriUriA parsed;\r
94 +       UriParserStateA parser;\r
95  \r
96         direntry = node->string;\r
97  \r
98 @@ -700,9 +703,20 @@ _notmuch_message_ensure_filename_list (notmuch_message_t *message)\r
99                                                           message->notmuch,\r
100                                                           directory_id);\r
101  \r
102 -       if (strlen (directory))\r
103 -           filename = talloc_asprintf (message, "%s/%s/%s",\r
104 -                                       db_path, directory, basename);\r
105 +       parser.uri = &parsed;\r
106 +\r
107 +       if (strlen (directory)) {\r
108 +           /* If directory is a URI, we don't need to append the db_path;\r
109 +            * it is already an absolute path. */\r
110 +           if (uriParseUriA (&parser, directory) != URI_SUCCESS ||\r
111 +               parsed.scheme.first == NULL)\r
112 +               filename = talloc_asprintf (message, "%s/%s/%s",\r
113 +                                           db_path, directory, basename);\r
114 +           else\r
115 +               filename = talloc_asprintf (message, "%s/%s",\r
116 +                                           directory, basename);\r
117 +           uriFreeUriMembersA (&parsed);\r
118 +       }\r
119         else\r
120             filename = talloc_asprintf (message, "%s/%s",\r
121                                         db_path, basename);\r
122 -- \r
123 1.7.9.5\r
124 \r