aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2019-05-01 22:33:22 +0200
committerKim Alvefur <zash@zash.se>2019-05-01 22:33:22 +0200
commit23dbdae2aafb4722367446dd700e972d9f499125 (patch)
tree9d68bcbbc5733b069ea988a86da4e57bd64f32ae /plugins
parenta399b1caed59abe4aa5a3c83656b2765cc478914 (diff)
downloadprosody-23dbdae2aafb4722367446dd700e972d9f499125.tar.gz
prosody-23dbdae2aafb4722367446dd700e972d9f499125.zip
mod_pubsub: Fix inclusion of publisher (fixes #1399)
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_pubsub/pubsub.lib.lua7
1 files changed, 5 insertions, 2 deletions
diff --git a/plugins/mod_pubsub/pubsub.lib.lua b/plugins/mod_pubsub/pubsub.lib.lua
index e7fa715d..6214882f 100644
--- a/plugins/mod_pubsub/pubsub.lib.lua
+++ b/plugins/mod_pubsub/pubsub.lib.lua
@@ -607,6 +607,9 @@ function handlers.set_publish(origin, stanza, publish, service)
item.attr.id = id;
end
end
+ if item then
+ item.attr.publisher = service.config.normalize_jid(stanza.attr.from);
+ end
local ok, ret = service:publish(node, stanza.attr.from, id, item, required_config);
local reply;
if ok then
@@ -795,8 +798,8 @@ function handlers.owner_set_affiliations(origin, stanza, affiliations, service)
return true;
end
-local function create_encapsulating_item(id, payload)
- local item = st.stanza("item", { id = id, xmlns = xmlns_pubsub });
+local function create_encapsulating_item(id, payload, publisher)
+ local item = st.stanza("item", { id = id, publisher = publisher, xmlns = xmlns_pubsub });
item:add_child(payload);
return item;
end