diff options
author | Badlop <badlop@process-one.net> | 2016-06-03 00:08:58 +0200 |
---|---|---|
committer | Badlop <badlop@process-one.net> | 2016-06-03 00:10:25 +0200 |
commit | 0503d899cfe86f6eeca2383bf2b9cbaf280280dc (patch) | |
tree | 1fd07564335113a1385190ef690df3146b56f913 | |
parent | Fix ejabberd.ldif (diff) |
-rw-r--r-- | src/mod_muc_room.erl | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/mod_muc_room.erl b/src/mod_muc_room.erl index 499c4dc01..61fa854f0 100644 --- a/src/mod_muc_room.erl +++ b/src/mod_muc_room.erl @@ -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 |