"snoozing" with notmuch?
[notmuch-archives.git] / 50 / e06239ec44ffff30da4374fad52320eeb6152e
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 74D7D431FB6\r
6         for <notmuch@notmuchmail.org>; Mon, 25 Jun 2012 13:43:35 -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 gaVyWTs22Yro for <notmuch@notmuchmail.org>;\r
18         Mon, 25 Jun 2012 13:43:34 -0700 (PDT)\r
19 Received: from mail-we0-f181.google.com (mail-we0-f181.google.com\r
20         [74.125.82.181]) (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 AD3FD431FAF\r
23         for <notmuch@notmuchmail.org>; Mon, 25 Jun 2012 13:43:34 -0700 (PDT)\r
24 Received: by mail-we0-f181.google.com with SMTP id j55so3641437wer.26\r
25         for <notmuch@notmuchmail.org>; Mon, 25 Jun 2012 13:43:34 -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=2g6fkbspKufW8i3FIxqeJ+0mMu74Hdt3y8rYV9jx2YM=;\r
29         b=NW7Q72PrWAc1OqxJppQQBwNdqdF85bfaMXDC1CuZVg9+vd3oxt1llqb0yfhzKzXxkD\r
30         L4qjMyNkNednQ3cHuNnAJBl20qRf7sZCevupc4Sjq238MrHdLzRoXLIJrm/S7gkcYgK9\r
31         jaMAQJOWwU1aWq99/lj60H0RLvHIt90fUIhss1I6adyGJ+5mTB2CaYSy8sf5bDV8i2mh\r
32         bFLMqTKAloX03n8aFLpj6VIWrHSrVmBuOISs+cUX7zRBl1Y6VqWlczmkknUgTtU8ccuj\r
33         dJ/kkBb666aADB/mV/O6xhGEFcTCXyfOGcgp8RTnfjuegmajNf5APoDoFc+7pauppvIY\r
34         JDuA==\r
35 Received: by 10.216.212.1 with SMTP id x1mr7098348weo.143.1340657011561;\r
36         Mon, 25 Jun 2012 13:43:31 -0700 (PDT)\r
37 Received: from localhost ([195.24.209.21])\r
38         by mx.google.com with ESMTPS id ei4sm37314729wid.5.2012.06.25.13.43.19\r
39         (version=TLSv1/SSLv3 cipher=OTHER);\r
40         Mon, 25 Jun 2012 13:43:30 -0700 (PDT)\r
41 From: Ethan Glasser-Camp <ethan.glasser.camp@gmail.com>\r
42 To: notmuch@notmuchmail.org\r
43 Subject: [RFC PATCH 04/14] Not all filenames need to be converted to absolute\r
44         paths\r
45 Date: Mon, 25 Jun 2012 16:41:29 -0400\r
46 Message-Id: <1340656899-5644-5-git-send-email-ethan@betacantrips.com>\r
47 X-Mailer: git-send-email 1.7.9.5\r
48 In-Reply-To: <1340656899-5644-1-git-send-email-ethan@betacantrips.com>\r
49 References: <1340656899-5644-1-git-send-email-ethan@betacantrips.com>\r
50 X-Mailman-Approved-At: Tue, 26 Jun 2012 03:51:54 -0700\r
51 X-BeenThere: notmuch@notmuchmail.org\r
52 X-Mailman-Version: 2.1.13\r
53 Precedence: list\r
54 List-Id: "Use and development of the notmuch mail system."\r
55         <notmuch.notmuchmail.org>\r
56 List-Unsubscribe: <http://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: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
62         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
63 X-List-Received-Date: Mon, 25 Jun 2012 20:43:35 -0000\r
64 \r
65 _notmuch_message_ensure_filename_list converts "relative" paths, such\r
66 as those stored in Xapian until now, to "absolute" paths. However,\r
67 URLs are already absolute, and prepending the database path will just\r
68 confuse matters.\r
69 \r
70 Signed-off-by: Ethan Glasser-Camp <ethan@betacantrips.com>\r
71 ---\r
72  lib/message.cc |   14 +++++++++++---\r
73  1 file changed, 11 insertions(+), 3 deletions(-)\r
74 \r
75 diff --git a/lib/message.cc b/lib/message.cc\r
76 index 978de06..c9857f5 100644\r
77 --- a/lib/message.cc\r
78 +++ b/lib/message.cc\r
79 @@ -700,9 +700,17 @@ _notmuch_message_ensure_filename_list (notmuch_message_t *message)\r
80                                                           message->notmuch,\r
81                                                           directory_id);\r
82  \r
83 -       if (strlen (directory))\r
84 -           filename = talloc_asprintf (message, "%s/%s/%s",\r
85 -                                       db_path, directory, basename);\r
86 +       if (strlen (directory)) {\r
87 +           /* If directory is a URI, we don't need to append the db_path;\r
88 +            * it is already an absolute path. */\r
89 +           /* This is just a quick hack instead of actually parsing the URL. */\r
90 +           if (strstr (directory, "://") == NULL)\r
91 +               filename = talloc_asprintf (message, "%s/%s/%s",\r
92 +                                           db_path, directory, basename);\r
93 +           else\r
94 +               filename = talloc_asprintf (message, "%s/%s",\r
95 +                                           directory, basename);\r
96 +       }\r
97         else\r
98             filename = talloc_asprintf (message, "%s/%s",\r
99                                         db_path, basename);\r
100 -- \r
101 1.7.9.5\r
102 \r