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
1 changed files with 9 additions and 1 deletions

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,