# HG changeset patch # User Kim Alvefur # Date 1655123139 -7200 # Node ID 59bedf167910e5dfad8fae659676a26110a39df8 # Parent 0989dea9b3563c129a743aa785451516f01b31d8 mod_muc_ping: Remove since Prosody mod_muc 0.11+ covers this natively See trunk rev 7c1cdf5f9f83 and trunk rev 224e681c4db2 diff -r 0989dea9b356 -r 59bedf167910 mod_muc_ping/README.markdown --- a/mod_muc_ping/README.markdown Sun Jun 05 21:59:17 2022 +0200 +++ b/mod_muc_ping/README.markdown Mon Jun 13 14:25:39 2022 +0200 @@ -1,3 +1,10 @@ +--- +labels: +- 'Stage-Obsolete' +superseded_by: mod_muc +summary: XEP-0410 Server Optimization (now supported by Prosody mod_muc) +--- + This module implements the [Server Optimization](https://xmpp.org/extensions/xep-0410.html#serveroptimization) part of [XEP-0410: MUC Self-Ping] diff -r 0989dea9b356 -r 59bedf167910 mod_muc_ping/mod_muc_ping.lua --- a/mod_muc_ping/mod_muc_ping.lua Sun Jun 05 21:59:17 2022 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +0,0 @@ -local st = require "util.stanza"; -local jid_bare = import("util.jid", "bare"); - -local mod_muc = module:depends"muc"; -local rooms = rawget(mod_muc, "rooms"); -if not rooms then - module:log("warn", "mod_%s is compatible with Prosody up to 0.10.x", module.name); - return; -end - -module:hook("iq/full", function (event) - local origin, stanza = event.origin, event.stanza; - if stanza.attr.type ~= "get" or not stanza:get_child("ping", "urn:xmpp:ping") then - return; - end - - local from = stanza.attr.from; - local room_nick = stanza.attr.to; - local room_jid = jid_bare(room_nick); - - local room = rooms[room_jid]; - if not room then return; end - - if room._jid_nick[from] == room_nick then - origin.send(st.reply(stanza)); - return true; - end -end); - -module:hook("muc-disco#info", function(event) - event.reply:tag("feature", {var="urn:xmpp:ping"}):up(); - event.reply:tag("feature", {var = "http://jabber.org/protocol/muc#self-ping-optimization"}):up(); -end);