Comparison

plugins/mod_pubsub/pubsub.lib.lua @ 12021:376522fb3f52

mod_pubsub: Allow specifying the JID of the pubsub service This allows overriding it in cases where it is not equal to module.host, like say, in mod_pep
author Kim Alvefur <zash@zash.se>
date Tue, 07 Dec 2021 13:03:55 +0100
parent 11904:313d01cc4258
child 12589:39ae08180c81
child 13177:6f64542a1336
comparison
equal deleted inserted replaced
12020:a949f1aae171 12021:376522fb3f52
307 event.origin.send(pubsub_error_reply(stanza, ret)); 307 event.origin.send(pubsub_error_reply(stanza, ret));
308 return true; 308 return true;
309 end 309 end
310 310
311 for _, id in ipairs(ret) do 311 for _, id in ipairs(ret) do
312 reply:tag("item", { jid = module.host, name = id }):up(); 312 reply:tag("item", { jid = service.jid or module.host, name = id }):up();
313 end 313 end
314 event.exists = true; 314 event.exists = true;
315 end 315 end
316 316
317 function _M.handle_pubsub_iq(event, service) 317 function _M.handle_pubsub_iq(event, service)