Software / code / prosody
Comparison
plugins/mod_pubsub.lua @ 3700:c8fcd63e9526
mod_pubsub: Ensure <item> is in correct scope when broadcasting an event
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Sun, 05 Dec 2010 19:54:48 +0000 |
| parent | 3699:150e58d69e60 |
| child | 3760:3bfb65496773 |
comparison
equal
deleted
inserted
replaced
| 3699:150e58d69e60 | 3700:c8fcd63e9526 |
|---|---|
| 149 end | 149 end |
| 150 return origin.send(reply); | 150 return origin.send(reply); |
| 151 end | 151 end |
| 152 | 152 |
| 153 function simple_broadcast(node, jids, item) | 153 function simple_broadcast(node, jids, item) |
| 154 item = st.clone(item); | |
| 155 item.attr.xmlns = nil; -- Clear the pubsub namespace | |
| 154 local message = st.message({ from = module.host, type = "headline" }) | 156 local message = st.message({ from = module.host, type = "headline" }) |
| 155 :tag("event", { xmlns = xmlns_pubsub_event }) | 157 :tag("event", { xmlns = xmlns_pubsub_event }) |
| 156 :tag("items", { node = node }) | 158 :tag("items", { node = node }) |
| 157 :add_child(item); | 159 :add_child(item); |
| 158 for jid in pairs(jids) do | 160 for jid in pairs(jids) do |