25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-22 16:20:52 +01:00

When user joins non-anonymous room, warn also in presence stanza (EJAB-310)

This commit is contained in:
Badlop 2010-08-07 20:48:36 +02:00
parent b0b98e8c63
commit da866ed326

View File

@ -1954,11 +1954,20 @@ send_new_presence(NJID, Reason, StateData) ->
false ->
[]
end,
Status2 = case ((StateData#state.config)#config.anonymous==false)
andalso (NJID == Info#user.jid) of
true ->
[#xmlel{name = 'status',
attrs = [?XMLATTR('code', <<"100">>)]}
| Status];
false ->
Status
end,
Packet = exmpp_xml:append_child(Presence,
#xmlel{ns = ?NS_MUC_USER, name = 'x',
children = [#xmlel{ns = ?NS_MUC_USER, name ='item',
attrs = ItemAttrs,
children = ItemEls} | Status]}),
children = ItemEls} | Status2]}),
ejabberd_router:route(
jid_replace_resource(StateData#state.jid, Nick),
Info#user.jid,