# HG changeset patch # User Kim Alvefur # Date 1627214505 -7200 # Node ID 605484fc1c62849d0c0492d14014265a6764fb12 # Parent 30f1e826cc959a230a70ec519aa402175c8e3fcc 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. diff -r 30f1e826cc95 -r 605484fc1c62 plugins/mod_pubsub/mod_pubsub.lua --- a/plugins/mod_pubsub/mod_pubsub.lua Sun Jul 25 13:52:52 2021 +0200 +++ b/plugins/mod_pubsub/mod_pubsub.lua Sun Jul 25 14:01:45 2021 +0200 @@ -57,7 +57,7 @@ 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 @@ 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