From 7c7e51b6e8d2cee4fb9ed29bcbd5e58081df1bd9 Mon Sep 17 00:00:00 2001 From: Holger Weiss Date: Sun, 28 Jun 2015 14:05:55 +0200 Subject: [PATCH] Omit warning message regarding non-anonymous room Previous versions of XEP-0045 suggested sending a warning message to new occupants of a non-anonymous MUC room. The current revision (1.25) says that a status code of "100" must be returned with the user's initial presence, instead. We already do this (in addition to generating the warning message). Receiving the warning message each time the client joins the room can become annoying, especially when reconnections occur frequently (e.g., on mobile devices). So, we omit it, now. --- src/mod_muc_room.erl | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/src/mod_muc_room.erl b/src/mod_muc_room.erl index f28fe0041..ff2ab5653 100644 --- a/src/mod_muc_room.erl +++ b/src/mod_muc_room.erl @@ -1853,31 +1853,6 @@ add_new_user(From, Nick, NewState = add_user_presence(From, Packet, add_online_user(From, Nick, Role, StateData)), - if not (NewState#state.config)#config.anonymous -> - WPacket = #xmlel{name = <<"message">>, - attrs = [{<<"type">>, <<"groupchat">>}], - children = - [#xmlel{name = <<"body">>, - attrs = [], - children = - [{xmlcdata, - translate:translate(Lang, - <<"This room is not anonymous">>)}]}, - #xmlel{name = <<"x">>, - attrs = - [{<<"xmlns">>, - ?NS_MUC_USER}], - children = - [#xmlel{name = - <<"status">>, - attrs = - [{<<"code">>, - <<"100">>}], - children = - []}]}]}, - ejabberd_router:route(StateData#state.jid, From, WPacket); - true -> ok - end, send_existing_presences(From, NewState), send_new_presence(From, NewState), Shift = count_stanza_shift(Nick, Els, NewState),