mirror of
https://github.com/processone/ejabberd.git
synced 2024-11-26 16:26:24 +01:00
When user joins non-anonymous room, warn also in presence stanza (EJAB-310)
This commit is contained in:
parent
b0b98e8c63
commit
da866ed326
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user