mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-11-21 18:38:08 +01:00
bindings/ruby: replacy use of deprecated notmuch_message_get_flag
Depending on the flag, this actually can return an errror, so raise a ruby exception if so.
This commit is contained in:
parent
c8539d5e92
commit
49d630d0f3
1 changed files with 6 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in a new issue