X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=bindings%2Fruby%2Fmessage.c;h=6ea82afa20c5071086883b437054d80613e7a45d;hb=d127b16afe2e5c0f245400bc74d96208372075a2;hp=cadc841f9bb04a0134e024e75c5a9dedca011e50;hpb=05dddf883dd762420bb8e6b86790e68d734fd568;p=notmuch diff --git a/bindings/ruby/message.c b/bindings/ruby/message.c index cadc841f..6ea82afa 100644 --- a/bindings/ruby/message.c +++ b/bindings/ruby/message.c @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ . + * along with this program. If not, see https://www.gnu.org/licenses/ . * * Author: Ali Polatel */ @@ -111,7 +111,7 @@ notmuch_rb_message_get_filename (VALUE self) } /* - * call-seq: MESSAGE.filanames => FILENAMES + * call-seq: MESSAGE.filenames => FILENAMES * * Get all filenames for the email corresponding to MESSAGE. */ @@ -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; } /* @@ -194,10 +199,6 @@ notmuch_rb_message_get_header (VALUE self, VALUE headerv) Data_Get_Notmuch_Message (self, message); -#if !defined(RSTRING_PTR) -#define RSTRING_PTR(v) (RSTRING((v))->ptr) -#endif /* !defined(RSTRING_PTR) */ - SafeStringValue (headerv); header = RSTRING_PTR (headerv); @@ -242,10 +243,6 @@ notmuch_rb_message_add_tag (VALUE self, VALUE tagv) Data_Get_Notmuch_Message (self, message); -#if !defined(RSTRING_PTR) -#define RSTRING_PTR(v) (RSTRING((v))->ptr) -#endif /* !defined(RSTRING_PTR) */ - SafeStringValue (tagv); tag = RSTRING_PTR (tagv); @@ -269,10 +266,6 @@ notmuch_rb_message_remove_tag (VALUE self, VALUE tagv) Data_Get_Notmuch_Message (self, message); -#if !defined(RSTRING_PTR) -#define RSTRING_PTR(v) (RSTRING((v))->ptr) -#endif /* !defined(RSTRING_PTR) */ - SafeStringValue (tagv); tag = RSTRING_PTR (tagv);