diff options
author | Alexey Shchepin <alexey@process-one.net> | 2003-01-24 20:18:33 +0000 |
---|---|---|
committer | Alexey Shchepin <alexey@process-one.net> | 2003-01-24 20:18:33 +0000 |
commit | 2aa3c1c7208823fedc77e7c8d1a50d2012676e78 (patch) | |
tree | 45e0eca88b360fd15f6a51cfb59f0b2b98e3dcca /src/mod_echo.erl | |
parent | *** empty log message *** (diff) |
*** empty log message ***
SVN Revision: 49
Diffstat (limited to 'src/mod_echo.erl')
-rw-r--r-- | src/mod_echo.erl | 14 |
1 files changed, 9 insertions, 5 deletions
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() -> |