aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorPhilipp Hancke <fippo@goodadvice.pages.de>2014-11-20 09:01:45 +0000
committerPhilipp Hancke <fippo@goodadvice.pages.de>2014-11-20 09:01:45 +0000
commite5282813cb1a618d76c4763d69d7dd354d8c12fc (patch)
treef418eb9a9dcd34b9c9c28aa74bc20340b0e708a9 /plugins
parent61b8eb49edf8e9a2d1ae2d55a898fc6e69a6f59e (diff)
downloadprosody-e5282813cb1a618d76c4763d69d7dd354d8c12fc.tar.gz
prosody-e5282813cb1a618d76c4763d69d7dd354d8c12fc.zip
mod_pubsub: Add support for including the publisher in item broadcasts
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_pubsub/mod_pubsub.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/plugins/mod_pubsub/mod_pubsub.lua b/plugins/mod_pubsub/mod_pubsub.lua
index 8c777f54..de027b58 100644
--- a/plugins/mod_pubsub/mod_pubsub.lua
+++ b/plugins/mod_pubsub/mod_pubsub.lua
@@ -11,6 +11,7 @@ local autocreate_on_publish = module:get_option_boolean("autocreate_on_publish",
local autocreate_on_subscribe = module:get_option_boolean("autocreate_on_subscribe", false);
local pubsub_disco_name = module:get_option("name");
if type(pubsub_disco_name) ~= "string" then pubsub_disco_name = "Prosody PubSub Service"; end
+local expose_publisher = module:get_option_boolean("expose_publisher", false)
local service;
@@ -36,10 +37,13 @@ function handle_pubsub_iq(event)
end
end
-function simple_broadcast(kind, node, jids, item)
+function simple_broadcast(kind, node, jids, item, actor)
if item then
item = st.clone(item);
item.attr.xmlns = nil; -- Clear the pubsub namespace
+ if expose_publisher and actor then
+ item.attr.publisher = actor
+ end
end
local message = st.message({ from = module.host, type = "headline" })
:tag("event", { xmlns = xmlns_pubsub_event })