Mercurial > prosody-hg
comparison plugins/mod_pubsub/mod_pubsub.lua @ 12212:bc6fc1cb04ae
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.
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Mon, 24 Jan 2022 23:05:26 +0100 |
| parents | 26af75c20163 |
| children | 82cf9d3ffeee |
comparison
equal
deleted
inserted
replaced
| 12211:5c2ae28f536e | 12212:bc6fc1cb04ae |
|---|---|
| 100 end | 100 end |
| 101 | 101 |
| 102 local summary; | 102 local summary; |
| 103 if item and item.tags[1] then | 103 if item and item.tags[1] then |
| 104 local payload = item.tags[1]; | 104 local payload = item.tags[1]; |
| 105 summary = module:fire_event("pubsub-summary/"..payload.attr.xmlns, { | 105 local payload_type = node_obj and node_obj.config.payload_type or payload.attr.xmlns; |
| 106 summary = module:fire_event("pubsub-summary/"..payload_type, { | |
| 106 kind = kind, node = node, jids = jids, actor = actor, item = item, payload = payload, | 107 kind = kind, node = node, jids = jids, actor = actor, item = item, payload = payload, |
| 107 }); | 108 }); |
| 108 end | 109 end |
| 109 | 110 |
| 110 for jid, options in pairs(jids) do | 111 for jid, options in pairs(jids) do |
