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

Fix problem in dfee843 when non-occupant admin kicks an occupant (#1135)

This commit is contained in:
Badlop 2016-06-03 00:08:58 +02:00
parent 0093326f7d
commit 0503d899cf

View File

@ -3145,14 +3145,7 @@ send_kickban_presence1(MJID, UJID, Reason, Code, Affiliation,
StateData#state.users),
SAffiliation = affiliation_to_list(Affiliation),
BannedJIDString = jid:to_string(RealJID),
case MJID /= <<"">> of
true ->
{ok, #user{nick = ActorNick}} =
(?DICT):find(jid:tolower(MJID),
StateData#state.users);
false ->
ActorNick = <<"">>
end,
ActorNick = get_actor_nick(MJID, StateData),
lists:foreach(fun ({_LJID, Info}) ->
JidAttrList = case Info#user.role == moderator orelse
(StateData#state.config)#config.anonymous
@ -3207,6 +3200,14 @@ send_kickban_presence1(MJID, UJID, Reason, Code, Affiliation,
end,
(?DICT):to_list(StateData#state.users)).
get_actor_nick(<<"">>, StateData) ->
<<"">>;
get_actor_nick(MJID, StateData) ->
case (?DICT):find(jid:tolower(MJID), StateData#state.users) of
{ok, #user{nick = ActorNick}} -> ActorNick;
_ -> <<"">>
end.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Owner stuff