]> git.notmuchmail.org Git - notmuch/blobdiff - bindings/ruby/message.c
bindings/ruby: replacy use of deprecated notmuch_message_get_flag
[notmuch] / bindings / ruby / message.c
index 4ff6097faf7795397c742f5b1c64fb2cb5eb30c8..6ea82afa20c5071086883b437054d80613e7a45d 100644 (file)
@@ -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 <alip@exherbo.org>
  */
@@ -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;
 }
 
 /*