comparison mod_restrict_xmpp/mod_restrict_xmpp.lua @ 5769:bb4335c8f500

mod_restrict_xmpp: Allow all XEP-0199 pings to self No permission to send a ping without a 'to' attribute?
author Kim Alvefur <zash@zash.se>
date Mon, 04 Dec 2023 00:23:19 +0100
parents 1d0a0d3f9593
children
comparison
equal deleted inserted replaced
5768:62654f523c6a 5769:bb4335c8f500
76 if typ ~= "set" and typ ~= "get" then return; end 76 if typ ~= "set" and typ ~= "get" then return; end
77 local action = typ == "get" and "read" or "write"; 77 local action = typ == "get" and "read" or "write";
78 78
79 local payload = stanza.tags[1]; 79 local payload = stanza.tags[1];
80 local ns = payload and payload.attr.xmlns; 80 local ns = payload and payload.attr.xmlns;
81 if ns == "urn:xmpp:ping" then return end
81 local proto = iq_namespaces[ns]; 82 local proto = iq_namespaces[ns];
82 if proto == "pep" then 83 if proto == "pep" then
83 local pubsub = payload:get_child("pubsub", "http://jabber.org/protocol/pubsub"); 84 local pubsub = payload:get_child("pubsub", "http://jabber.org/protocol/pubsub");
84 local node = pubsub and #pubsub.tags == 1 and pubsub.tags[1].attr.node or nil; 85 local node = pubsub and #pubsub.tags == 1 and pubsub.tags[1].attr.node or nil;
85 proto = pep_nodes[node] or "pep"; 86 proto = pep_nodes[node] or "pep";