2 local helper = require "util.discohelper".new();
\r
4 local jid_split = require "util.jid".split;
\r
5 local jid_bare = require "util.jid".bare;
\r
6 local usermanager_user_exists = require "core.usermanager".user_exists;
\r
7 local rostermanager_is_contact_subscribed = require "core.rostermanager".is_contact_subscribed;
\r
10 helper:addDiscoInfoHandler("*host", function(reply, to, from, node)
\r
12 reply:tag("identity", {category="server", type="im", name="lxmppd"}):up();
\r
16 helper:addDiscoInfoHandler("*node", function(reply, to, from, node)
\r
17 local node, host = jid_split(to);
\r
18 if hosts[host] and rostermanager_is_contact_subscribed(node, host, jid_bare(from)) then
\r
19 reply:tag("identity", {category="account", type="registered"}):up();
\r
25 module "discomanager"
\r
27 function handle(stanza)
\r
28 return helper:handle(stanza);
\r
31 function addDiscoItemsHandler(jid, func)
\r
32 return helper:addDiscoItemsHandler(jid, func);
\r
35 function addDiscoInfoHandler(jid, func)
\r
36 return helper:addDiscoInfoHandler(jid, func);
\r