From c73aeca3934cdc64799254a809291a02f5b8bbde Mon Sep 17 00:00:00 2001 From: Badlop Date: Thu, 7 Apr 2011 13:12:52 +0200 Subject: [PATCH] Send jid attribute when occupant is banned (EJAB-1432) --- src/mod_muc/mod_muc_room.erl | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/mod_muc/mod_muc_room.erl b/src/mod_muc/mod_muc_room.erl index cbcb195fa..96305cfe3 100644 --- a/src/mod_muc/mod_muc_room.erl +++ b/src/mod_muc/mod_muc_room.erl @@ -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 "" -> [];