From 4dc5192c99ce2739952ab77b386f76b987f52dc2 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sun, 25 Jul 2021 14:01:45 +0200 Subject: mod_pubsub: Normalize 'publisher' JID All the XEP-0060 examples have the publisher attribute set to a bare JID, but the text does allow it to be the full JID. Since mod_pubsub is more likely used for open nodes that anyone can subscribe to it makes sense to not leak the full JIDs. This is also disabled by defaults. In mod_pep on the other hand it might make sense to have the full JID since that data is more likely to be broadcast to contacts which are already somewhat trusted. --- plugins/mod_pubsub/mod_pubsub.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'plugins/mod_pubsub/mod_pubsub.lua') diff --git a/plugins/mod_pubsub/mod_pubsub.lua b/plugins/mod_pubsub/mod_pubsub.lua index 6866312c..dfe60f73 100644 --- a/plugins/mod_pubsub/mod_pubsub.lua +++ b/plugins/mod_pubsub/mod_pubsub.lua @@ -57,7 +57,7 @@ local function create_simple_itemstore(node_config, node_name) --> util.cache li return lib_pubsub.archive_itemstore(archive, max_items, nil, node_name); end -function simple_broadcast(kind, node, jids, item, actor, node_obj) +function simple_broadcast(kind, node, jids, item, actor, node_obj, service) if node_obj then if node_obj.config["notify_"..kind] == false then return; @@ -75,7 +75,7 @@ function simple_broadcast(kind, node, jids, item, actor, node_obj) item:maptags(function () return nil; end); end if expose_publisher and actor then - item.attr.publisher = actor + item.attr.publisher = service.config.normalize_jid(actor); end end end -- cgit v1.2.3