From 2aa3c1c7208823fedc77e7c8d1a50d2012676e78 Mon Sep 17 00:00:00 2001 From: Alexey Shchepin Date: Fri, 24 Jan 2003 20:18:33 +0000 Subject: *** empty log message *** SVN Revision: 49 --- src/mod_echo.erl | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src/mod_echo.erl') diff --git a/src/mod_echo.erl b/src/mod_echo.erl index 06266dd0c..03a25d25e 100644 --- a/src/mod_echo.erl +++ b/src/mod_echo.erl @@ -10,18 +10,22 @@ -author('alexey@sevcom.net'). -vsn('$Revision$ '). --export([start/0, init/0]). +-behaviour(gen_mod). + +-export([start/1, init/1]). -include("ejabberd.hrl"). -include("namespaces.hrl"). -start() -> - spawn(?MODULE, init, []). +start(Opts) -> + %Host = gen_mod:get_opt(host, Opts), + Host = gen_mod:get_opt(host, Opts, "echo." ++ ?MYNAME), + spawn(?MODULE, init, [Host]). -init() -> - ejabberd_router:register_local_route("echo." ++ ?MYNAME), +init(Host) -> + ejabberd_router:register_local_route(Host), loop(). loop() -> -- cgit v1.2.3