1 Return-Path: <alip@exherbo.org>
\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 BBAD1431FB6
\r
6 for <notmuch@notmuchmail.org>; Mon, 10 Jan 2011 06:39:29 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
8 X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References"
\r
12 X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]
\r
14 Received: from olra.theworths.org ([127.0.0.1])
\r
15 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
16 with ESMTP id iJD4KgtISaZy for <notmuch@notmuchmail.org>;
\r
17 Mon, 10 Jan 2011 06:39:28 -0800 (PST)
\r
18 Received: from bach.exherbo.org (bach.exherbo.org [78.47.197.147])
\r
19 (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
\r
20 (No client certificate requested)
\r
21 by olra.theworths.org (Postfix) with ESMTPS id 51BD1431FD0
\r
22 for <notmuch@notmuchmail.org>; Mon, 10 Jan 2011 06:39:27 -0800 (PST)
\r
23 Received: from localhost ([127.0.0.1] helo=karatren.karatren.ev ident=alip)
\r
24 by bach.exherbo.org with esmtpa (Exim 4.71)
\r
25 (envelope-from <alip@exherbo.org>)
\r
26 id 1PcIu0-0006iv-Pk; Mon, 10 Jan 2011 14:39:21 +0000
\r
27 Received: by karatren.karatren.ev (Postfix, from userid 1000)
\r
28 id 6150F1BAA28; Mon, 10 Jan 2011 16:39:28 +0200 (EET)
\r
29 From: Ali Polatel <alip@exherbo.org>
\r
30 To: notmuch@notmuchmail.org
\r
31 Subject: [PATCH 2/4] ruby: Add wrappers for maildir sync. interface
\r
32 Date: Mon, 10 Jan 2011 16:39:26 +0200
\r
34 <b958b56b5bfd9a30be0936a07416965b01c3029e.1294669955.git.alip@exherbo.org>
\r
35 X-Mailer: git-send-email 1.7.3.5
\r
36 In-Reply-To: <cover.1294669955.git.alip@exherbo.org>
\r
37 References: <cover.1294669955.git.alip@exherbo.org>
\r
38 In-Reply-To: <cover.1294669955.git.alip@exherbo.org>
\r
39 References: <cover.1294669955.git.alip@exherbo.org>
\r
40 Organization: Pink Floyd
\r
41 X-BeenThere: notmuch@notmuchmail.org
\r
42 X-Mailman-Version: 2.1.13
\r
44 List-Id: "Use and development of the notmuch mail system."
\r
45 <notmuch.notmuchmail.org>
\r
46 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
47 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
48 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
49 List-Post: <mailto:notmuch@notmuchmail.org>
\r
50 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
51 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
52 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
53 X-List-Received-Date: Mon, 10 Jan 2011 14:39:30 -0000
\r
56 notmuch_message_maildir_flags_to_tags(): MESSAGE.maildir_flags_to_tags
\r
57 notmuch_message_tags_to_maildir_flags(): MESSAGE.tags_to_maildir_flags
\r
59 bindings/ruby/defs.h | 6 ++++++
\r
60 bindings/ruby/init.c | 2 ++
\r
61 bindings/ruby/message.c | 38 ++++++++++++++++++++++++++++++++++++++
\r
62 3 files changed, 46 insertions(+), 0 deletions(-)
\r
64 diff --git a/bindings/ruby/defs.h b/bindings/ruby/defs.h
\r
65 index db53096..1f52988 100644
\r
66 --- a/bindings/ruby/defs.h
\r
67 +++ b/bindings/ruby/defs.h
\r
68 @@ -293,6 +293,12 @@ VALUE
\r
69 notmuch_rb_message_remove_all_tags(VALUE self);
\r
72 +notmuch_rb_message_maildir_flags_to_tags(VALUE self);
\r
75 +notmuch_rb_message_tags_to_maildir_flags(VALUE self);
\r
78 notmuch_rb_message_freeze(VALUE self);
\r
81 diff --git a/bindings/ruby/init.c b/bindings/ruby/init.c
\r
82 index 63ab205..4a63ba0 100644
\r
83 --- a/bindings/ruby/init.c
\r
84 +++ b/bindings/ruby/init.c
\r
85 @@ -273,6 +273,8 @@ Init_notmuch(void)
\r
86 rb_define_alias(notmuch_rb_cMessage, "<<", "add_tag");
\r
87 rb_define_method(notmuch_rb_cMessage, "remove_tag", notmuch_rb_message_remove_tag, 1);
\r
88 rb_define_method(notmuch_rb_cMessage, "remove_all_tags", notmuch_rb_message_remove_all_tags, 0);
\r
89 + rb_define_method(notmuch_rb_cMessage, "maildir_flags_to_tags", notmuch_rb_message_maildir_flags_to_tags, 0);
\r
90 + rb_define_method(notmuch_rb_cMessage, "tags_to_maildir_flags", notmuch_rb_message_tags_to_maildir_flags, 0);
\r
91 rb_define_method(notmuch_rb_cMessage, "freeze", notmuch_rb_message_freeze, 0);
\r
92 rb_define_method(notmuch_rb_cMessage, "thaw", notmuch_rb_message_thaw, 0);
\r
94 diff --git a/bindings/ruby/message.c b/bindings/ruby/message.c
\r
95 index f97e1a4..1b2c01e 100644
\r
96 --- a/bindings/ruby/message.c
\r
97 +++ b/bindings/ruby/message.c
\r
98 @@ -284,6 +284,44 @@ notmuch_rb_message_remove_all_tags(VALUE self)
\r
102 + * call-seq: MESSAGE.maildir_flags_to_tags => true
\r
104 + * Add/remove tags according to maildir flags in the message filename(s)
\r
107 +notmuch_rb_message_maildir_flags_to_tags(VALUE self)
\r
109 + notmuch_status_t ret;
\r
110 + notmuch_message_t *message;
\r
112 + Data_Get_Notmuch_Message(self, message);
\r
114 + ret = notmuch_message_maildir_flags_to_tags(message);
\r
115 + notmuch_rb_status_raise(ret);
\r
121 + * call-seq: MESSAGE.tags_to_maildir_flags => true
\r
123 + * Rename message filename(s) to encode tags as maildir flags
\r
126 +notmuch_rb_message_tags_to_maildir_flags(VALUE self)
\r
128 + notmuch_status_t ret;
\r
129 + notmuch_message_t *message;
\r
131 + Data_Get_Notmuch_Message(self, message);
\r
133 + ret = notmuch_message_tags_to_maildir_flags(message);
\r
134 + notmuch_rb_status_raise(ret);
\r
140 * call-seq: MESSAGE.freeze => true
\r
142 * Freeze the 'message'
\r