summaryrefslogtreecommitdiffstats
path: root/bindings
diff options
context:
space:
mode:
authorDavid Bremner <david@tethera.net>2020-07-11 15:30:08 -0300
committerDavid Bremner <david@tethera.net>2020-07-18 11:03:29 -0300
commit49d630d0f389e0bfb08a83178582f4a38f1ec664 (patch)
tree478c5800a82fec1a90428902be52372fc7092ba8 /bindings
parentc8539d5e9248f08f417165e765814a1ed3d777e1 (diff)
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.
Diffstat (limited to 'bindings')
-rw-r--r--bindings/ruby/message.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/bindings/ruby/message.c b/bindings/ruby/message.c
index c55cf6e2..6ea82afa 100644
--- a/bindings/ruby/message.c
+++ b/bindings/ruby/message.c
@@ -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;
}
/*