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:
authorMickaël Rémond <mickael.remond@process-one.net>2007-07-11 12:37:30 +0400
committerMickaël Rémond <mickael.remond@process-one.net>2007-07-11 12:37:30 +0400
commitb16e3f6d0b2b6202c3d9cdb5a05f440b10c3277f (patch)
tree194b778c15672439a1ab69699cbf6aeb1f54d886
parent3fe646c3cba731aa7ec6544916bc46fdfd52ea82 (diff)
* src/mod_echo.erl: mod_echo does not reply to other components. This is to make sure that a component will not discover its own capabilities (EJAB-281).
* src/ejabberd.cfg: disable mod_echo in the example config file. mod_echo is mainly a development/test module. SVN Revision: 810
-rw-r--r--ChangeLog8
-rw-r--r--src/mod_echo.erl6
2 files changed, 13 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index a6a915429..ed5c89eea 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2007-07-11 Mickael Remond <mickael.remond@process-one.net>
+
+ * src/mod_echo.erl: mod_echo does not reply to other
+ components. This is to make sure that a component will not
+ discover its own capabilities (EJAB-281).
+ * src/ejabberd.cfg: disable mod_echo in the example config
+ file. mod_echo is mainly a development/test module.
+
2007-07-09 Mickael Remond <mickael.remond@process-one.net>
* src/odbc/mssql.sql: Nickname cannot be null in rosterusers table
diff --git a/src/mod_echo.erl b/src/mod_echo.erl
index c2b466ee5..5d7474ac7 100644
--- a/src/mod_echo.erl
+++ b/src/mod_echo.erl
@@ -100,7 +100,11 @@ handle_cast(_Msg, State) ->
%% Description: Handling all non call/cast messages
%%--------------------------------------------------------------------
handle_info({route, From, To, Packet}, State) ->
- ejabberd_router:route(To, From, Packet),
+ Packet2 = case From#jid.user of
+ "" -> jlib:make_error_reply(Packet, ?ERR_BAD_REQUEST);
+ _ -> Packet
+ end,
+ ejabberd_router:route(To, From, Packet2),
{noreply, State};
handle_info(_Info, State) ->
{noreply, State}.