plugins/mod_disco.lua
changeset 1704 9b445d2427e2
parent 1703 b062ee7865fc
child 2383 29a30884aadd
child 2923 b7049746bd29
equal deleted inserted replaced
1703:b062ee7865fc 1704:9b445d2427e2
     5 -- This project is MIT/X11 licensed. Please see the
     5 -- This project is MIT/X11 licensed. Please see the
     6 -- COPYING file in the source package for more information.
     6 -- COPYING file in the source package for more information.
     7 --
     7 --
     8 
     8 
     9 local componentmanager_get_children = require "core.componentmanager".get_children;
     9 local componentmanager_get_children = require "core.componentmanager".get_children;
       
    10 local st = require "util.stanza"
    10 
    11 
       
    12 module:add_identity("server", "im", "Prosody"); -- FIXME should be in the non-existing mod_router
    11 module:add_feature("http://jabber.org/protocol/disco#info");
    13 module:add_feature("http://jabber.org/protocol/disco#info");
    12 module:add_feature("http://jabber.org/protocol/disco#items");
    14 module:add_feature("http://jabber.org/protocol/disco#items");
    13 
    15 
    14 module:add_identity("server", "im", "Prosody");
       
    15 local st = require "util.stanza"
       
    16 module:hook("iq/host/http://jabber.org/protocol/disco#info:query", function(event)
    16 module:hook("iq/host/http://jabber.org/protocol/disco#info:query", function(event)
    17 	local origin, stanza = event.origin, event.stanza;
    17 	local origin, stanza = event.origin, event.stanza;
    18 	if stanza.attr.type ~= "get" then return; end
    18 	if stanza.attr.type ~= "get" then return; end
    19 	local node = stanza.tags[1].attr.node;
    19 	local node = stanza.tags[1].attr.node;
    20 	if node and node ~= "" then return; end -- TODO fire event?
    20 	if node and node ~= "" then return; end -- TODO fire event?