From f2f78d4bf9f5c3af39cc684bff851e49e3ad1d00 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Tue, 7 Dec 2021 13:03:55 +0100 Subject: 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 --- plugins/mod_pubsub/mod_pubsub.lua | 1 + plugins/mod_pubsub/pubsub.lib.lua | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/mod_pubsub/mod_pubsub.lua b/plugins/mod_pubsub/mod_pubsub.lua index ed895cf4..be460f72 100644 --- a/plugins/mod_pubsub/mod_pubsub.lua +++ b/plugins/mod_pubsub/mod_pubsub.lua @@ -231,6 +231,7 @@ function module.load() check_node_config = check_node_config; get_affiliation = get_affiliation; + jid = module.host; normalize_jid = jid_bare; })); end diff --git a/plugins/mod_pubsub/pubsub.lib.lua b/plugins/mod_pubsub/pubsub.lib.lua index 971a7fd0..83cef808 100644 --- a/plugins/mod_pubsub/pubsub.lib.lua +++ b/plugins/mod_pubsub/pubsub.lib.lua @@ -309,7 +309,7 @@ function _M.handle_disco_items_node(event, service) end for _, id in ipairs(ret) do - reply:tag("item", { jid = module.host, name = id }):up(); + reply:tag("item", { jid = service.jid or module.host, name = id }):up(); end event.exists = true; end -- cgit v1.2.3