Software /
code /
prosody
Comparison
plugins/mod_disco.lua @ 3348:3b84a84f472a
mod_disco: Respond to disco#info to the correct caps hash node ("node#ver").
author | Waqas Hussain <waqas20@gmail.com> |
---|---|
date | Sun, 11 Jul 2010 23:51:40 +0500 |
parent | 3347:99f56bed5228 |
child | 3349:a416d714a905 |
comparison
equal
deleted
inserted
replaced
3347:99f56bed5228 | 3348:3b84a84f472a |
---|---|
85 -- Handle disco requests to the server | 85 -- Handle disco requests to the server |
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 ~= 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 = st.reply(stanza):add_child(get_server_disco_info()); |
92 origin.send(reply); | 92 origin.send(reply); |
93 return true; | 93 return true; |
94 end); | 94 end); |
95 module:hook("iq/host/http://jabber.org/protocol/disco#items:query", function(event) | 95 module:hook("iq/host/http://jabber.org/protocol/disco#items:query", function(event) |