# HG changeset patch # User Matthew Wild # Date 1416474143 0 # Node ID ecd8d6437053c93269bcf420907460cafc8ac6cf # Parent d425fc41e59f8f710a9fc9f673ea17a1ff1f76e2# Parent c9a72c64c3e29ab6c9de0d5d71322af1f3c375b9 Merge 0.10->trunk diff -r d425fc41e59f -r ecd8d6437053 plugins/mod_pubsub/mod_pubsub.lua --- a/plugins/mod_pubsub/mod_pubsub.lua Tue Nov 18 14:14:41 2014 -0500 +++ b/plugins/mod_pubsub/mod_pubsub.lua Thu Nov 20 09:02:23 2014 +0000 @@ -11,6 +11,7 @@ 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 @@ 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 }) diff -r d425fc41e59f -r ecd8d6437053 util/pubsub.lua --- a/util/pubsub.lua Tue Nov 18 14:14:41 2014 -0500 +++ b/util/pubsub.lua Thu Nov 20 09:02:23 2014 +0000 @@ -294,7 +294,7 @@ node_data[id] = item; trim_items(node_data, node_obj.config["pubsub#max_items"]); self.events.fire_event("item-published", { node = node, actor = actor, id = id, item = item }); - self.config.broadcaster("items", node, node_obj.subscribers, item); + self.config.broadcaster("items", node, node_obj.subscribers, item, actor); return true; end