comparison mod_pubsub_serverinfo/mod_pubsub_serverinfo.lua @ 5809:a8cae8322b7c

mod_pubsub_serverinfo: Fix namespace parsing issue with disco/info Prosody's API works based on attribute definitions, without using namespace scopes.
author Guus der Kinderen <guus.der.kinderen@gmail.com>
date Thu, 04 Jan 2024 15:15:51 +0100
parents 2465d5191ae9
children 76b57bcfe1b2
comparison
equal deleted inserted replaced
5808:2465d5191ae9 5809:a8cae8322b7c
224 module:send_iq(discoRequest):next( 224 module:send_iq(discoRequest):next(
225 function(response) 225 function(response)
226 if response.stanza ~= nil and response.stanza.attr.type == "result" then 226 if response.stanza ~= nil and response.stanza.attr.type == "result" then
227 local query = response.stanza:get_child("query", "http://jabber.org/protocol/disco#info") 227 local query = response.stanza:get_child("query", "http://jabber.org/protocol/disco#info")
228 if query ~= nil then 228 if query ~= nil then
229 for feature in query:childtags("feature", "http://jabber.org/protocol/disco#info") do 229 for feature in query:childtags("feature") do
230 module:log("debug", "Disco/info feature for '%s': %s", remoteDomain, feature) 230 module:log("debug", "Disco/info feature for '%s': %s", remoteDomain, feature)
231 if feature.attr.var == 'urn:xmpp:serverinfo:0' then 231 if feature.attr.var == 'urn:xmpp:serverinfo:0' then
232 module:log("debug", "Disco/info response included opt-in for '%s'", remoteDomain) 232 module:log("debug", "Disco/info response included opt-in for '%s'", remoteDomain)
233 opt_in_cache[remoteDomain] = { 233 opt_in_cache[remoteDomain] = {
234 opt_in = true; 234 opt_in = true;