25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-28 16:34:13 +01:00

Send jid attribute when occupant is banned (EJAB-1432)

This commit is contained in:
Badlop 2011-04-07 12:54:39 +02:00
parent aded966370
commit 449e56ed52

View File

@ -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
"" ->
[];