X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=bindings%2Fruby%2Fmessage.c;h=49dbace3afec546596fc15e117354f16b031689f;hp=f97e1a4ef1f0f04bad3ed4a1941eb5aeb4bb39fd;hb=b4049316cc3bc933453268ed8d3e89b1ee0098a1;hpb=44ea57a0d10ddab514abea319c4d25ec4e36b51e diff --git a/bindings/ruby/message.c b/bindings/ruby/message.c index f97e1a4e..49dbace3 100644 --- a/bindings/ruby/message.c +++ b/bindings/ruby/message.c @@ -110,6 +110,24 @@ notmuch_rb_message_get_filename(VALUE self) return rb_str_new2(fname); } +/* + * call-seq: MESSAGE.filanames => FILENAMES + * + * Get all filenames for the email corresponding to MESSAGE. + */ +VALUE +notmuch_rb_message_get_filenames(VALUE self) +{ + notmuch_filenames_t *fnames; + notmuch_message_t *message; + + Data_Get_Notmuch_Message(self, message); + + fnames = notmuch_message_get_filenames(message); + + return Data_Wrap_Struct(notmuch_rb_cFileNames, NULL, NULL, fnames); +} + /* * call-seq: MESSAGE.get_flag(flag) => true or false * @@ -283,6 +301,44 @@ notmuch_rb_message_remove_all_tags(VALUE self) return Qtrue; } +/* + * 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 *