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:
parent
f893669d91
commit
c73aeca393
@ -2756,13 +2756,20 @@ 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}} = ?DICT:find(UJID, StateData#state.users),
|
nick = Nick}} = ?DICT:find(UJID, StateData#state.users),
|
||||||
SAffiliation = affiliation_to_binary(Affiliation),
|
SAffiliation = affiliation_to_binary(Affiliation),
|
||||||
|
BannedJID = exmpp_jid:to_binary(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 -> [?XMLATTR(<<"jid">>, BannedJID)];
|
||||||
|
false -> []
|
||||||
|
end,
|
||||||
ItemAttrs = [?XMLATTR(<<"affiliation">>, SAffiliation),
|
ItemAttrs = [?XMLATTR(<<"affiliation">>, SAffiliation),
|
||||||
?XMLATTR(<<"role">>, <<"none">>)],
|
?XMLATTR(<<"role">>, <<"none">>)] ++ JidAttrList,
|
||||||
ItemEls = case Reason of
|
ItemEls = case Reason of
|
||||||
"" ->
|
"" ->
|
||||||
[];
|
[];
|
||||||
|
Loading…
Reference in New Issue
Block a user