diff options
| author | frosty <frostinator33@airmail.cc> | 2026-10-26 10:21:57 -0400 |
|---|---|---|
| committer | frosty <frostinator33@airmail.cc> | 2026-10-26 10:21:57 -0400 |
| commit | 74aecd8b0986d07b50b7ce310d64e645b8b54e38 (patch) | |
| tree | 560e6434f183eb54cd779936f3a4c9575146a066 /xmpp-vala/src/module/xep/0425_message_moderation.vala | |
| parent | 3d7e90d401da02d430a87db0ec7e1db3a6f1a68f (diff) | |
| parent | 4436001bb361ad4f9e4e05819214ecf0ea77c063 (diff) | |
Merge 'upstream/master'
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 |
