aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2022-01-24 23:05:26 +0100
committerKim Alvefur <zash@zash.se>2022-01-24 23:05:26 +0100
commit55da054c9b111f4543ad87d62f252e4aec95fcfb (patch)
tree9e4f22cb4a3bf725399284cfd17ea427299bc816
parentc0be43a098730e9413e77bc2e8e7b8678eae7712 (diff)
downloadprosody-55da054c9b111f4543ad87d62f252e4aec95fcfb.tar.gz
prosody-55da054c9b111f4543ad87d62f252e4aec95fcfb.zip
mod_pubsub: Use the 'pubsub#type' setting to pick summary generator
Allows using different ones even if multiple semantically different formats share the same root element xmlns, e.g. generic Atom and XEP-0277 entries.
-rw-r--r--plugins/mod_pubsub/mod_pubsub.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/plugins/mod_pubsub/mod_pubsub.lua b/plugins/mod_pubsub/mod_pubsub.lua
index 4af16a6f..f096fd8b 100644
--- a/plugins/mod_pubsub/mod_pubsub.lua
+++ b/plugins/mod_pubsub/mod_pubsub.lua
@@ -102,7 +102,8 @@ function simple_broadcast(kind, node, jids, item, actor, node_obj, service) --lu
local summary;
if item and item.tags[1] then
local payload = item.tags[1];
- summary = module:fire_event("pubsub-summary/"..payload.attr.xmlns, {
+ local payload_type = node_obj and node_obj.config.payload_type or payload.attr.xmlns;
+ summary = module:fire_event("pubsub-summary/"..payload_type, {
kind = kind, node = node, jids = jids, actor = actor, item = item, payload = payload,
});
end