mirror of
https://github.com/processone/ejabberd.git
synced 2024-12-26 17:38:45 +01:00
Send jid attribute when occupant is banned (EJAB-1432)
This commit is contained in:
parent
aded966370
commit
449e56ed52
@ -2667,14 +2667,21 @@ send_kickban_presence(JID, Reason, Code, NewAffiliation, StateData) ->
|
||||
end, LJIDs).
|
||||
|
||||
send_kickban_presence1(UJID, Reason, Code, Affiliation, StateData) ->
|
||||
{ok, #user{jid = _RealJID,
|
||||
{ok, #user{jid = RealJID,
|
||||
nick = Nick}} =
|
||||
?DICT:find(jlib:jid_tolower(UJID), StateData#state.users),
|
||||
SAffiliation = affiliation_to_list(Affiliation),
|
||||
BannedJIDString = jlib:jid_to_string(RealJID),
|
||||
lists:foreach(
|
||||
fun({_LJID, Info}) ->
|
||||
JidAttrList = case (Info#user.role == moderator) orelse
|
||||
((StateData#state.config)#config.anonymous
|
||||
== false) of
|
||||
true -> [{"jid", BannedJIDString}];
|
||||
false -> []
|
||||
end,
|
||||
ItemAttrs = [{"affiliation", SAffiliation},
|
||||
{"role", "none"}],
|
||||
{"role", "none"}] ++ JidAttrList,
|
||||
ItemEls = case Reason of
|
||||
"" ->
|
||||
[];
|
||||
|
Loading…
Reference in New Issue
Block a user