aboutsummaryrefslogtreecommitdiff
path: root/bindings/ruby/message.c
diff options
context:
space:
mode:
authorAli Polatel <alip@exherbo.org>2011-01-10 16:02:43 +0200
committerAli Polatel <alip@exherbo.org>2011-01-25 12:03:37 +0200
commit02369d031c1499e015db1736bd259d314d39b8cf (patch)
tree1546fc803e0761bbd6590af277cba6fb7c4c01be /bindings/ruby/message.c
parented38940323ba80d0136688405cbd923fa088d706 (diff)
ruby: Add wrappers for maildir sync. interface
New wrappers: notmuch_message_maildir_flags_to_tags(): MESSAGE.maildir_flags_to_tags notmuch_message_tags_to_maildir_flags(): MESSAGE.tags_to_maildir_flags
Diffstat (limited to 'bindings/ruby/message.c')
-rw-r--r--bindings/ruby/message.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/bindings/ruby/message.c b/bindings/ruby/message.c
index f97e1a4..1b2c01e 100644
--- a/bindings/ruby/message.c
+++ b/bindings/ruby/message.c
@@ -284,6 +284,44 @@ notmuch_rb_message_remove_all_tags(VALUE self)
}
/*
+ * call-seq: MESSAGE.maildir_flags_to_tags => true
+ *
+ * Add/remove tags according to maildir flags in the message filename(s)
+ */
+VALUE
+notmuch_rb_message_maildir_flags_to_tags(VALUE self)
+{
+ notmuch_status_t ret;
+ notmuch_message_t *message;
+
+ Data_Get_Notmuch_Message(self, message);
+
+ ret = notmuch_message_maildir_flags_to_tags(message);
+ notmuch_rb_status_raise(ret);
+
+ return Qtrue;
+}
+
+/*
+ * call-seq: MESSAGE.tags_to_maildir_flags => true
+ *
+ * Rename message filename(s) to encode tags as maildir flags
+ */
+VALUE
+notmuch_rb_message_tags_to_maildir_flags(VALUE self)
+{
+ notmuch_status_t ret;
+ notmuch_message_t *message;
+
+ Data_Get_Notmuch_Message(self, message);
+
+ ret = notmuch_message_tags_to_maildir_flags(message);
+ notmuch_rb_status_raise(ret);
+
+ return Qtrue;
+}
+
+/*
* call-seq: MESSAGE.freeze => true
*
* Freeze the 'message'