Skip to content

Commit

Permalink
Ping a MUC if it returns an error
Browse files Browse the repository at this point in the history
Should do periodic pings eventually as well.
  • Loading branch information
singpolyma committed Jul 9, 2024
1 parent 4270b3e commit a74f415
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions snikket/Client.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit a74f415

Please sign in to comment.