From a74f415a84739162606092687fd19da6ade7254c Mon Sep 17 00:00:00 2001 From: Stephen Paul Weber Date: Tue, 9 Jul 2024 11:24:55 -0500 Subject: [PATCH] Ping a MUC if it returns an error Should do periodic pings eventually as well. --- snikket/Client.hx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/snikket/Client.hx b/snikket/Client.hx index 9fadc86..a930012 100644 --- a/snikket/Client.hx +++ b/snikket/Client.hx @@ -124,6 +124,12 @@ class Client extends EventEmitter { final stanza:Stanza = event.stanza; final from = stanza.attr.get("from") == null ? null : JID.parse(stanza.attr.get("from")); + if (stanza.attr.get("type") == "error" && from != null) { + final chat = getChat(from.asBare().asString()); + final channel = Std.downcast(chat, Channel); + if (channel != null) channel.selfPing(); + } + var fwd = null; if (from != null && from.asBare().asString() == accountId()) { var carbon = stanza.getChild("received", "urn:xmpp:carbons:2");