X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=bindings%2Fruby%2Fmessage.c;h=1990bb979c425e10aaeeb20e2fe54f67c30164c7;hp=c55cf6e20d11b8faf3e10d979ad43a79952499db;hb=fba9774a81e90a179ccfa810c47a501eaf266e2b;hpb=045f0e455ac94e2393d0d729c9bbdf3459a4860f diff --git a/bindings/ruby/message.c b/bindings/ruby/message.c index c55cf6e2..1990bb97 100644 --- a/bindings/ruby/message.c +++ b/bindings/ruby/message.c @@ -89,7 +89,7 @@ notmuch_rb_message_get_replies (VALUE self) messages = notmuch_message_get_replies (message); - return Data_Wrap_Struct (notmuch_rb_cMessages, NULL, NULL, messages); + return Data_Wrap_Notmuch_Object (notmuch_rb_cMessages, messages); } /* @@ -125,7 +125,7 @@ notmuch_rb_message_get_filenames (VALUE self) fnames = notmuch_message_get_filenames (message); - return Data_Wrap_Struct (notmuch_rb_cFileNames, NULL, NULL, fnames); + return Data_Wrap_Notmuch_Object (notmuch_rb_cFileNames, fnames); } /* @@ -137,13 +137,18 @@ VALUE notmuch_rb_message_get_flag (VALUE self, VALUE flagv) { notmuch_message_t *message; + notmuch_bool_t is_set; + notmuch_status_t status; Data_Get_Notmuch_Message (self, message); if (!FIXNUM_P (flagv)) rb_raise (rb_eTypeError, "Flag not a Fixnum"); - return notmuch_message_get_flag (message, FIX2INT (flagv)) ? Qtrue : Qfalse; + status = notmuch_message_get_flag_st (message, FIX2INT (flagv), &is_set); + notmuch_rb_status_raise (status); + + return is_set ? Qtrue : Qfalse; } /* @@ -221,7 +226,7 @@ notmuch_rb_message_get_tags (VALUE self) if (!tags) rb_raise (notmuch_rb_eMemoryError, "Out of memory"); - return Data_Wrap_Struct (notmuch_rb_cTags, NULL, NULL, tags); + return Data_Wrap_Notmuch_Object (notmuch_rb_cTags, tags); } /*