plugins/mod_disco.lua
changeset 8005 57060d0cee4b
parent 5081 c0c060e450be
child 8006 15973ade9a11
child 8158 f0d847316723
equal deleted inserted replaced
7942:6940d6db970b 8005:57060d0cee4b
    97 	local origin, stanza = event.origin, event.stanza;
    97 	local origin, stanza = event.origin, event.stanza;
    98 	if stanza.attr.type ~= "get" then return; end
    98 	if stanza.attr.type ~= "get" then return; end
    99 	local node = stanza.tags[1].attr.node;
    99 	local node = stanza.tags[1].attr.node;
   100 	if node and node ~= "" and node ~= "http://prosody.im#"..get_server_caps_hash() then return; end -- TODO fire event?
   100 	if node and node ~= "" and node ~= "http://prosody.im#"..get_server_caps_hash() then return; end -- TODO fire event?
   101 	local reply_query = get_server_disco_info();
   101 	local reply_query = get_server_disco_info();
   102 	reply_query.node = node;
   102 	reply_query.attr.node = node;
   103 	local reply = st.reply(stanza):add_child(reply_query);
   103 	local reply = st.reply(stanza):add_child(reply_query);
   104 	origin.send(reply);
   104 	origin.send(reply);
   105 	return true;
   105 	return true;
   106 end);
   106 end);
   107 module:hook("iq/host/http://jabber.org/protocol/disco#items:query", function(event)
   107 module:hook("iq/host/http://jabber.org/protocol/disco#items:query", function(event)