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/0425_message_moderation.vala | |
| parent | 630b1368331ef0034b343bd2f00b116c8cd90391 (diff) | |
Fix more warnings
Diffstat (limited to 'xmpp-vala/src/module/xep/0425_message_moderation.vala')
| -rw-r--r-- | xmpp-vala/src/module/xep/0425_message_moderation.vala | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/xmpp-vala/src/module/xep/0425_message_moderation.vala b/xmpp-vala/src/module/xep/0425_message_moderation.vala index 80fab905..934e5ff3 100644 --- a/xmpp-vala/src/module/xep/0425_message_moderation.vala +++ b/xmpp-vala/src/module/xep/0425_message_moderation.vala @@ -7,13 +7,17 @@ namespace Xmpp.Xep.MessageModeration { * @return whether the moderation was successful */ public static async bool moderate(XmppStream stream, Jid muc_jid, string message_id) { - StanzaNode moderate_node = new StanzaNode.build("moderate", NS_URI) - .add_self_xmlns() - .put_attribute("id", message_id) - .put_node(new StanzaNode.build("retract", Xep.MessageRetraction.NS_URI).add_self_xmlns()); - Iq.Stanza iq = new Iq.Stanza.set(moderate_node) { to = muc_jid }; + try { + StanzaNode moderate_node = new StanzaNode.build("moderate", NS_URI) + .add_self_xmlns() + .put_attribute("id", message_id) + .put_node(new StanzaNode.build("retract", Xep.MessageRetraction.NS_URI).add_self_xmlns()); + Iq.Stanza iq = new Iq.Stanza.set(moderate_node) { to = muc_jid }; - Iq.Stanza result_stanza = yield stream.get_module(Iq.Module.IDENTITY).send_iq_async(stream, iq); - return !result_stanza.is_error(); + Iq.Stanza result_stanza = yield stream.get_module(Iq.Module.IDENTITY).send_iq_async(stream, iq); + return !result_stanza.is_error(); + } catch (IOError e) { + return false; + } } }
\ No newline at end of file |
