mod_tls: Advertise and handle TLS for s2s connections
[prosody.git] / plugins / mod_selftests.lua
index 8aa70952dc68345ee24415bf296272f77c96ab8e..1f41363445089d670ec03995812c3d6b813c5e11 100644 (file)
@@ -1,10 +1,18 @@
+-- Prosody IM
+-- Copyright (C) 2008-2009 Matthew Wild
+-- Copyright (C) 2008-2009 Waqas Hussain
+-- 
+-- This project is MIT/X11 licensed. Please see the
+-- COPYING file in the source package for more information.
+--
+
+module.host = "*" -- Global module
 
 local st = require "util.stanza";
 local register_component = require "core.componentmanager".register_component;
 local core_route_stanza = core_route_stanza;
 local socket = require "socket";
-local config = require "core.configmanager";
-local ping_hosts = config.get("*", "mod_selftests", "ping_hosts") or { "coversant.interop.xmpp.org", "djabberd.interop.xmpp.org", "djabberd-trunk.interop.xmpp.org", "ejabberd.interop.xmpp.org", "openfire.interop.xmpp.org" };
+local ping_hosts = module:get_option("ping_hosts") or { "coversant.interop.xmpp.org", "djabberd.interop.xmpp.org", "djabberd-trunk.interop.xmpp.org", "ejabberd.interop.xmpp.org", "openfire.interop.xmpp.org" };
 
 local open_pings = {};
 
@@ -36,7 +44,7 @@ if tests_jid and host then
 
 
        local our_origin = hosts[host];
-       add_event_hook("server-started", 
+       module:add_event_hook("server-started", 
                                        function ()
                                                local id = st.new_id();
                                                local ping_attr = { xmlns = 'urn:xmpp:ping' };