Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/processone/ejabberd.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/mod_echo.erl')
-rw-r--r--src/mod_echo.erl14
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() ->