Created
August 7, 2009 09:23
-
-
Save zeen/163809 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- this module is global | |
module.host = "*"; | |
-- list of hosts on which to add the component | |
local hosts = { | |
["example.com"] = true; | |
["myhost.com"] = true; | |
}; | |
-- the jid of the component | |
local components = { | |
["muc.server.com"] = true; | |
["conference.jabber.org"] = true; | |
} | |
-- code doing the adding | |
local unloaded; | |
require "core.discomanager".addDiscoItemsHandler("*host", function(reply, to, from, node) | |
if not unloaded and #node == 0 and hosts[to] then | |
for jid in pairs(components) do | |
reply:tag("item", {jid = jid}):up(); | |
end | |
return true; | |
end | |
end); | |
module.unload = function() | |
unloaded = true; | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment