mirror of
https://github.com/processone/ejabberd.git
synced 2024-11-24 16:23:40 +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).
|
end, LJIDs).
|
||||||
|
|
||||||
send_kickban_presence1(UJID, Reason, Code, Affiliation, StateData) ->
|
send_kickban_presence1(UJID, Reason, Code, Affiliation, StateData) ->
|
||||||
{ok, #user{jid = _RealJID,
|
{ok, #user{jid = RealJID,
|
||||||
nick = Nick}} =
|
nick = Nick}} =
|
||||||
?DICT:find(jlib:jid_tolower(UJID), StateData#state.users),
|
?DICT:find(jlib:jid_tolower(UJID), StateData#state.users),
|
||||||
SAffiliation = affiliation_to_list(Affiliation),
|
SAffiliation = affiliation_to_list(Affiliation),
|
||||||
|
BannedJIDString = jlib:jid_to_string(RealJID),
|
||||||
lists:foreach(
|
lists:foreach(
|
||||||
fun({_LJID, Info}) ->
|
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},
|
ItemAttrs = [{"affiliation", SAffiliation},
|
||||||
{"role", "none"}],
|
{"role", "none"}] ++ JidAttrList,
|
||||||
ItemEls = case Reason of
|
ItemEls = case Reason of
|
||||||
"" ->
|
"" ->
|
||||||
[];
|
[];
|
||||||
|
Loading…
Reference in New Issue
Block a user