Software / code / prosody
Comparison
plugins/mod_pubsub.lua @ 3916:ffe5a0d36f57
mod_pubsub: Return disco#info stanza from build_disco_info()
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Tue, 21 Dec 2010 04:15:54 +0000 |
| parent | 3915:e24fcbb01fb6 |
| child | 3918:f30c5bad29b8 |
comparison
equal
deleted
inserted
replaced
| 3915:e24fcbb01fb6 | 3916:ffe5a0d36f57 |
|---|---|
| 203 end | 203 end |
| 204 end | 204 end |
| 205 end | 205 end |
| 206 | 206 |
| 207 local function build_disco_info(service) | 207 local function build_disco_info(service) |
| 208 disco_info = st.stanza("query", { xmlns = "http://jabber.org/protocol/disco#info" }) | 208 local disco_info = st.stanza("query", { xmlns = "http://jabber.org/protocol/disco#info" }) |
| 209 :tag("identity", { category = "pubsub", type = "service" }):up() | 209 :tag("identity", { category = "pubsub", type = "service" }):up() |
| 210 :tag("feature", { var = "http://jabber.org/protocol/pubsub" }):up(); | 210 :tag("feature", { var = "http://jabber.org/protocol/pubsub" }):up(); |
| 211 add_disco_features_from_service(disco_info, service); | 211 add_disco_features_from_service(disco_info, service); |
| 212 return disco_info; | |
| 212 end | 213 end |
| 213 | 214 |
| 214 module:hook("iq-get/host/http://jabber.org/protocol/disco#info:query", function (event) | 215 module:hook("iq-get/host/http://jabber.org/protocol/disco#info:query", function (event) |
| 215 event.origin.send(st.reply(event.stanza):add_child(disco_info)); | 216 event.origin.send(st.reply(event.stanza):add_child(disco_info)); |
| 216 return true; | 217 return true; |