From e412438aba993255029af680cf558aa245861f5c Mon Sep 17 00:00:00 2001 From: Badlop Date: Wed, 2 Dec 2015 12:07:29 +0100 Subject: [PATCH] When user joins logged room, he must be warned (EJAB-726) --- src/mod_muc_room.erl | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/mod_muc_room.erl b/src/mod_muc_room.erl index 9f31907c3..cb85f2963 100644 --- a/src/mod_muc_room.erl +++ b/src/mod_muc_room.erl @@ -2193,6 +2193,15 @@ send_new_presence1(NJID, Reason, StateData) -> | Status2]; false -> Status2 end, + Status4 = case (StateData#state.config)#config.logging of + true -> + [#xmlel{name = <<"status">>, + attrs = + [{<<"code">>, <<"170">>}], + children = []} + | Status3]; + false -> Status3 + end, Packet = xml:append_subtags(Presence, [#xmlel{name = <<"x">>, attrs = @@ -2207,7 +2216,7 @@ send_new_presence1(NJID, Reason, StateData) -> children = ItemEls} - | Status3]}]), + | Status4]}]), ejabberd_router:route(jid:replace_resource(StateData#state.jid, Nick), Info#user.jid, Packet)