25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-22 16:20:52 +01:00

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

This commit is contained in:
Badlop 2011-04-07 13:12:52 +02:00
parent f893669d91
commit c73aeca393

View File

@ -2756,13 +2756,20 @@ 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(UJID, StateData#state.users),
SAffiliation = affiliation_to_binary(Affiliation),
BannedJID = exmpp_jid:to_binary(RealJID),
lists:foreach(
fun({_LJID, Info}) ->
JidAttrList = case (Info#user.role == moderator) orelse
((StateData#state.config)#config.anonymous
== false) of
true -> [?XMLATTR(<<"jid">>, BannedJID)];
false -> []
end,
ItemAttrs = [?XMLATTR(<<"affiliation">>, SAffiliation),
?XMLATTR(<<"role">>, <<"none">>)],
?XMLATTR(<<"role">>, <<"none">>)] ++ JidAttrList,
ItemEls = case Reason of
"" ->
[];