From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id IBPLBlMFCl9CYwAA0tVLHw (envelope-from ) for ; Sat, 11 Jul 2020 18:30:43 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id KL5sAlMFCl8BUQAAbx9fmQ (envelope-from ) for ; Sat, 11 Jul 2020 18:30:43 +0000 Received: from mail.notmuchmail.org (nmbug.tethera.net [144.217.243.247]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 8F42A940D35 for ; Sat, 11 Jul 2020 18:30:42 +0000 (UTC) Received: from [144.217.243.247] (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 285CF2007E; Sat, 11 Jul 2020 14:30:29 -0400 (EDT) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by mail.notmuchmail.org (Postfix) with ESMTP id 9B72620030 for ; Sat, 11 Jul 2020 14:30:19 -0400 (EDT) Received: by fethera.tethera.net (Postfix, from userid 1001) id 807C7613B0; Sat, 11 Jul 2020 14:30:19 -0400 (EDT) Received: (nullmailer pid 1594894 invoked by uid 1000); Sat, 11 Jul 2020 18:30:15 -0000 From: David Bremner To: notmuch@notmuchmail.org Cc: David Bremner Subject: [PATCH 5/5] bindings/ruby: replacy use of deprecated notmuch_message_get_flag Date: Sat, 11 Jul 2020 15:30:08 -0300 Message-Id: <20200711183008.1593624-6-david@tethera.net> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200711183008.1593624-1-david@tethera.net> References: <20200711183008.1593624-1-david@tethera.net> MIME-Version: 1.0 Message-ID-Hash: L4ODCOWY6HEIYHDAIFWHDU4EPDUE6VZG X-Message-ID-Hash: L4ODCOWY6HEIYHDAIFWHDU4EPDUE6VZG X-MailFrom: bremner@tethera.net X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.1 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 144.217.243.247 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Spam-Score: 0.03 X-TUID: 3iqdQjUdbIpv Depending on the flag, this actually can return an errror, so raise a ruby exception if so. --- bindings/ruby/message.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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; } /* -- 2.27.0