ruby: Add wrapper for message_get_filenames

This commit is contained in:
Ali Polatel 2011-01-10 16:03:31 +02:00
parent 02369d031c
commit 90a66779e1
3 changed files with 22 additions and 0 deletions

View file

@ -268,6 +268,9 @@ notmuch_rb_message_get_replies(VALUE self);
VALUE VALUE
notmuch_rb_message_get_filename(VALUE self); notmuch_rb_message_get_filename(VALUE self);
VALUE
notmuch_rb_message_get_filenames(VALUE self);
VALUE VALUE
notmuch_rb_message_get_flag(VALUE self, VALUE flagv); notmuch_rb_message_get_flag(VALUE self, VALUE flagv);

View file

@ -263,6 +263,7 @@ Init_notmuch(void)
rb_define_method(notmuch_rb_cMessage, "thread_id", notmuch_rb_message_get_thread_id, 0); rb_define_method(notmuch_rb_cMessage, "thread_id", notmuch_rb_message_get_thread_id, 0);
rb_define_method(notmuch_rb_cMessage, "replies", notmuch_rb_message_get_replies, 0); rb_define_method(notmuch_rb_cMessage, "replies", notmuch_rb_message_get_replies, 0);
rb_define_method(notmuch_rb_cMessage, "filename", notmuch_rb_message_get_filename, 0); rb_define_method(notmuch_rb_cMessage, "filename", notmuch_rb_message_get_filename, 0);
rb_define_method(notmuch_rb_cMessage, "filenames", notmuch_rb_message_get_filenames, 0);
rb_define_method(notmuch_rb_cMessage, "get_flag", notmuch_rb_message_get_flag, 1); rb_define_method(notmuch_rb_cMessage, "get_flag", notmuch_rb_message_get_flag, 1);
rb_define_method(notmuch_rb_cMessage, "set_flag", notmuch_rb_message_set_flag, 2); rb_define_method(notmuch_rb_cMessage, "set_flag", notmuch_rb_message_set_flag, 2);
rb_define_method(notmuch_rb_cMessage, "date", notmuch_rb_message_get_date, 0); rb_define_method(notmuch_rb_cMessage, "date", notmuch_rb_message_get_date, 0);

View file

@ -110,6 +110,24 @@ notmuch_rb_message_get_filename(VALUE self)
return rb_str_new2(fname); 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 * call-seq: MESSAGE.get_flag(flag) => true or false
* *