Changeset

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
parents 12020:a949f1aae171
children 12022:eedd3eff0768
files plugins/mod_pubsub/mod_pubsub.lua plugins/mod_pubsub/pubsub.lib.lua
diffstat 2 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/mod_pubsub/mod_pubsub.lua	Mon Dec 06 22:38:27 2021 +0100
+++ b/plugins/mod_pubsub/mod_pubsub.lua	Tue Dec 07 13:03:55 2021 +0100
@@ -231,6 +231,7 @@
 		check_node_config = check_node_config;
 		get_affiliation = get_affiliation;
 
+		jid = module.host;
 		normalize_jid = jid_bare;
 	}));
 end
--- a/plugins/mod_pubsub/pubsub.lib.lua	Mon Dec 06 22:38:27 2021 +0100
+++ b/plugins/mod_pubsub/pubsub.lib.lua	Tue Dec 07 13:03:55 2021 +0100
@@ -309,7 +309,7 @@
 	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