From 3e136fc57a2e509e5a4dd265a798b196205b0a80 Mon Sep 17 00:00:00 2001 From: Marvin W Date: Sun, 4 Oct 2026 22:02:19 +0200 Subject: Fix more warnings --- xmpp-vala/src/module/xep/0410_muc_self_ping.vala | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'xmpp-vala/src/module/xep/0410_muc_self_ping.vala') diff --git a/xmpp-vala/src/module/xep/0410_muc_self_ping.vala b/xmpp-vala/src/module/xep/0410_muc_self_ping.vala index 84772333..6511789e 100644 --- a/xmpp-vala/src/module/xep/0410_muc_self_ping.vala +++ b/xmpp-vala/src/module/xep/0410_muc_self_ping.vala @@ -1,16 +1,20 @@ namespace Xmpp.Xep.MucSelfPing { public static async bool is_joined(XmppStream stream, Jid jid) { - Iq.Stanza iq_result = yield stream.get_module(Xmpp.Xep.Ping.Module.IDENTITY).send_ping(stream, jid); + try { + Iq.Stanza iq_result = yield stream.get_module(Xmpp.Xep.Ping.Module.IDENTITY).send_ping(stream, jid); - if (!iq_result.is_error()) { - return true; - } else { - var error_stanza = iq_result.get_error(); - if (error_stanza.condition in new string[] {ErrorStanza.CONDITION_SERVICE_UNAVAILABLE, ErrorStanza.CONDITION_FEATURE_NOT_IMPLEMENTED}) { - // the client is joined, but the pinged client does not implement XMPP Ping + if (!iq_result.is_error()) { return true; + } else { + var error_stanza = iq_result.get_error(); + if (error_stanza.condition in new string[] {ErrorStanza.CONDITION_SERVICE_UNAVAILABLE, ErrorStanza.CONDITION_FEATURE_NOT_IMPLEMENTED}) { + // the client is joined, but the pinged client does not implement XMPP Ping + return true; + } } + } catch (IOError e) { + // Ignoring, same as if ping failed } return false; } -- cgit v1.3