diff options
| author | Marvin W <git@larma.de> | 2026-10-04 22:02:19 +0200 |
|---|---|---|
| committer | Marvin W <git@larma.de> | 2026-10-23 17:01:43 +0200 |
| commit | 3e136fc57a2e509e5a4dd265a798b196205b0a80 (patch) | |
| tree | c8f9fc5d82bc458c27cf378bf1bf3f0fda51497b /xmpp-vala/src/module/xep/0410_muc_self_ping.vala | |
| parent | 630b1368331ef0034b343bd2f00b116c8cd90391 (diff) | |
Fix more warnings
Diffstat (limited to 'xmpp-vala/src/module/xep/0410_muc_self_ping.vala')
| -rw-r--r-- | xmpp-vala/src/module/xep/0410_muc_self_ping.vala | 18 |
1 files changed, 11 insertions, 7 deletions
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; } |
