X-Git-Url: https://git.enpas.org/?a=blobdiff_plain;f=plugins%2Fmod_selftests.lua;h=1f41363445089d670ec03995812c3d6b813c5e11;hb=7457d58d551120e47eb5bcac81028108cff199de;hp=8aa70952dc68345ee24415bf296272f77c96ab8e;hpb=9d00edf26b5b5ecd832f45ab698a5a49c93e67c9;p=prosody.git diff --git a/plugins/mod_selftests.lua b/plugins/mod_selftests.lua index 8aa70952..1f413634 100644 --- a/plugins/mod_selftests.lua +++ b/plugins/mod_selftests.lua @@ -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' };