Software /
code /
prosody-modules
Comparison
mod_admin_web/admin_web/mod_admin_web.lua @ 769:7076f58b9f48
mod_admin_web: Move comment to appropriate line
author | Florian Zeitz <florob@babelmonkeys.de> |
---|---|
date | Fri, 03 Aug 2012 14:56:59 +0200 |
parent | 761:48f8b312a509 |
child | 770:a85d86a7f24e |
comparison
equal
deleted
inserted
replaced
768:af06e69c807a | 769:7076f58b9f48 |
---|---|
142 end; | 142 end; |
143 ["GET /*"] = serve_file; | 143 ["GET /*"] = serve_file; |
144 } | 144 } |
145 }); | 145 }); |
146 | 146 |
147 -- Setup adminsub service | |
147 local function simple_broadcast(node, jids, item) | 148 local function simple_broadcast(node, jids, item) |
148 item = st.clone(item); | 149 item = st.clone(item); |
149 item.attr.xmlns = nil; -- Clear the pubsub namespace | 150 item.attr.xmlns = nil; -- Clear the pubsub namespace |
150 local message = st.message({ from = module.host, type = "headline" }) | 151 local message = st.message({ from = module.host, type = "headline" }) |
151 :tag("event", { xmlns = xmlns_adminsub .. "#event" }) | 152 :tag("event", { xmlns = xmlns_adminsub .. "#event" }) |
156 message.attr.to = jid; | 157 message.attr.to = jid; |
157 module:send(message); | 158 module:send(message); |
158 end | 159 end |
159 end | 160 end |
160 | 161 |
161 | |
162 -- Setup adminsub service | |
163 local ok, err; | 162 local ok, err; |
164 service[module.host] = pubsub.new({ | 163 service[module.host] = pubsub.new({ |
165 broadcaster = simple_broadcast; | 164 broadcaster = simple_broadcast; |
166 normalize_jid = jid_bare; | 165 normalize_jid = jid_bare; |
167 get_affiliation = function(jid) return get_affiliation(jid, module.host) end; | 166 get_affiliation = function(jid) return get_affiliation(jid, module.host) end; |