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:
parent
b14899d41a
commit
972440c2ca
@ -1887,10 +1887,18 @@ send_new_presence(NJID, Reason, StateData) ->
|
|||||||
false ->
|
false ->
|
||||||
[]
|
[]
|
||||||
end,
|
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(
|
Packet = xml:append_subtags(
|
||||||
Presence,
|
Presence,
|
||||||
[{xmlelement, "x", [{"xmlns", ?NS_MUC_USER}],
|
[{xmlelement, "x", [{"xmlns", ?NS_MUC_USER}],
|
||||||
[{xmlelement, "item", ItemAttrs, ItemEls} | Status]}]),
|
[{xmlelement, "item", ItemAttrs, ItemEls} | Status2]}]),
|
||||||
ejabberd_router:route(
|
ejabberd_router:route(
|
||||||
jlib:jid_replace_resource(StateData#state.jid, Nick),
|
jlib:jid_replace_resource(StateData#state.jid, Nick),
|
||||||
Info#user.jid,
|
Info#user.jid,
|
||||||
|
Loading…
Reference in New Issue
Block a user