Mercurial > prosody-hg
comparison plugins/mod_disco.lua @ 3349:a416d714a905
mod_disco: Reflect requested 'node' attribute in the disco#info reply.
| author | Waqas Hussain <waqas20@gmail.com> |
|---|---|
| date | Mon, 12 Jul 2010 00:14:48 +0500 |
| parents | 3b84a84f472a |
| children | fb7fc154a56a |
comparison
equal
deleted
inserted
replaced
| 3348:3b84a84f472a | 3349:a416d714a905 |
|---|---|
| 86 module:hook("iq/host/http://jabber.org/protocol/disco#info:query", function(event) | 86 module:hook("iq/host/http://jabber.org/protocol/disco#info:query", function(event) |
| 87 local origin, stanza = event.origin, event.stanza; | 87 local origin, stanza = event.origin, event.stanza; |
| 88 if stanza.attr.type ~= "get" then return; end | 88 if stanza.attr.type ~= "get" then return; end |
| 89 local node = stanza.tags[1].attr.node; | 89 local node = stanza.tags[1].attr.node; |
| 90 if node and node ~= "" and node ~= "http://prosody.im#"..get_server_caps_hash() then return; end -- TODO fire event? | 90 if node and node ~= "" and node ~= "http://prosody.im#"..get_server_caps_hash() then return; end -- TODO fire event? |
| 91 local reply = st.reply(stanza):add_child(get_server_disco_info()); | 91 local reply_query = get_server_disco_info(); |
| 92 reply_query.node = node; | |
| 93 local reply = st.reply(stanza):add_child(reply_query); | |
| 92 origin.send(reply); | 94 origin.send(reply); |
| 93 return true; | 95 return true; |
| 94 end); | 96 end); |
| 95 module:hook("iq/host/http://jabber.org/protocol/disco#items:query", function(event) | 97 module:hook("iq/host/http://jabber.org/protocol/disco#items:query", function(event) |
| 96 local origin, stanza = event.origin, event.stanza; | 98 local origin, stanza = event.origin, event.stanza; |
