From e6400cd0d86b2d76d9bb737d9b86f063acd3dca0 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Tue, 30 Oct 2018 18:20:54 +0100 Subject: pubsub: Set pubsub#title as name attribute in disco#items (fixes #1226) --- plugins/mod_pep.lua | 2 +- plugins/mod_pubsub/mod_pubsub.lua | 2 +- spec/scansion/pubsub_config.scs | 205 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 207 insertions(+), 2 deletions(-) create mode 100644 spec/scansion/pubsub_config.scs diff --git a/plugins/mod_pep.lua b/plugins/mod_pep.lua index 681e5be8..1d8c55bf 100644 --- a/plugins/mod_pep.lua +++ b/plugins/mod_pep.lua @@ -464,6 +464,6 @@ module:hook("account-disco-items", function(event) if not ok then return; end for node, node_obj in pairs(ret) do - reply:tag("item", { jid = user_bare, node = node, name = node_obj.config.name }):up(); + reply:tag("item", { jid = user_bare, node = node, name = node_obj.config.title }):up(); end end); diff --git a/plugins/mod_pubsub/mod_pubsub.lua b/plugins/mod_pubsub/mod_pubsub.lua index 05d2d663..40adcafe 100644 --- a/plugins/mod_pubsub/mod_pubsub.lua +++ b/plugins/mod_pubsub/mod_pubsub.lua @@ -152,7 +152,7 @@ module:hook("host-disco-items", function (event) return; end for node, node_obj in pairs(ret) do - reply:tag("item", { jid = module.host, node = node, name = node_obj.config.name }):up(); + reply:tag("item", { jid = module.host, node = node, name = node_obj.config.title }):up(); end end); diff --git a/spec/scansion/pubsub_config.scs b/spec/scansion/pubsub_config.scs new file mode 100644 index 00000000..d979aca5 --- /dev/null +++ b/spec/scansion/pubsub_config.scs @@ -0,0 +1,205 @@ +# pubsub#title as name attribute in disco#items +# Issue 1226 + +[Client] Romeo + password: password + jid: jqpcrbq@localhost + +----- + +Romeo connects + +Romeo sends: + + + + + + + + + + +Romeo receives: + + + + + + + + +Romeo sends: + + + + + + +Romeo receives: + + + + + + http://jabber.org/protocol/pubsub#node_config + + + + + + + 1 + + + 1 + + + + + + + + presence + + + + + + publishers + + + 1 + + + 1 + + + + + headline + + + 1 + + + 1 + + + + + + +Romeo sends: + + + + + + http://jabber.org/protocol/pubsub#node_config + + + Nice tunes + + + + + + 1 + + + 1 + + + + + + + + presence + + + + + + publishers + + + 1 + + + 1 + + + + + headline + + + 1 + + + 1 + + + + + + +Romeo receives: + + +Romeo sends: + + + + +Romeo receives: + + + + + + +Romeo disconnects + -- cgit v1.2.3