25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-24 16:23:40 +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 b14899d41a
commit 972440c2ca

View File

@ -1887,10 +1887,18 @@ send_new_presence(NJID, Reason, StateData) ->
false ->
[]
end,
Status2 = case ((StateData#state.config)#config.anonymous==false)
andalso (NJID == Info#user.jid) of
true ->
[{xmlelement, "status", [{"code", "100"}], []}
| Status];
false ->
Status
end,
Packet = xml:append_subtags(
Presence,
[{xmlelement, "x", [{"xmlns", ?NS_MUC_USER}],
[{xmlelement, "item", ItemAttrs, ItemEls} | Status]}]),
[{xmlelement, "item", ItemAttrs, ItemEls} | Status2]}]),
ejabberd_router:route(
jlib:jid_replace_resource(StateData#state.jid, Nick),
Info#user.jid,