mirror of
https://github.com/processone/ejabberd.git
synced 2024-11-26 16:26:24 +01:00
Provide new, not old, affiliation in kick/ban presence with codes 321 and 301
This commit is contained in:
parent
d146ef873d
commit
3e9de2ec79
@ -2371,7 +2371,7 @@ process_admin_items_set3({JID, affiliation, none, Reason}, SD) ->
|
|||||||
case (SD#state.config)#config.members_only of
|
case (SD#state.config)#config.members_only of
|
||||||
true ->
|
true ->
|
||||||
catch send_kickban_presence(
|
catch send_kickban_presence(
|
||||||
JID, Reason, "321", SD),
|
JID, Reason, "321", none, SD),
|
||||||
SD1 = set_affiliation(JID, none, SD),
|
SD1 = set_affiliation(JID, none, SD),
|
||||||
set_role(JID, none, SD1);
|
set_role(JID, none, SD1);
|
||||||
_ ->
|
_ ->
|
||||||
@ -2382,7 +2382,7 @@ process_admin_items_set3({JID, affiliation, none, Reason}, SD) ->
|
|||||||
|
|
||||||
process_admin_items_set3({JID, affiliation, outcast, Reason}, SD) ->
|
process_admin_items_set3({JID, affiliation, outcast, Reason}, SD) ->
|
||||||
catch send_kickban_presence(
|
catch send_kickban_presence(
|
||||||
JID, Reason, "301", SD),
|
JID, Reason, "301", outcast, SD),
|
||||||
set_affiliation_and_reason(
|
set_affiliation_and_reason(
|
||||||
JID, outcast, Reason,
|
JID, outcast, Reason,
|
||||||
set_role(JID, none, SD));
|
set_role(JID, none, SD));
|
||||||
@ -2726,6 +2726,11 @@ can_change_ra(_FAffiliation, _FRole,
|
|||||||
|
|
||||||
|
|
||||||
send_kickban_presence(JID, Reason, Code, StateData) ->
|
send_kickban_presence(JID, Reason, Code, StateData) ->
|
||||||
|
{N,D,R} = JID,
|
||||||
|
NewAffiliation = get_affiliation(exmpp_jid:make(N,D,R), StateData),
|
||||||
|
send_kickban_presence(JID, Reason, Code, NewAffiliation, StateData).
|
||||||
|
|
||||||
|
send_kickban_presence(JID, Reason, Code, NewAffiliation, StateData) ->
|
||||||
LJID = jlib:short_prepd_jid(JID),
|
LJID = jlib:short_prepd_jid(JID),
|
||||||
LJIDs = case LJID of
|
LJIDs = case LJID of
|
||||||
{U, S, undefined} ->
|
{U, S, undefined} ->
|
||||||
@ -2751,14 +2756,12 @@ send_kickban_presence(JID, Reason, Code, StateData) ->
|
|||||||
?DICT:find(J, StateData#state.users),
|
?DICT:find(J, StateData#state.users),
|
||||||
add_to_log(kickban, {Nick, Reason, Code}, StateData),
|
add_to_log(kickban, {Nick, Reason, Code}, StateData),
|
||||||
tab_remove_online_user(J, StateData),
|
tab_remove_online_user(J, StateData),
|
||||||
send_kickban_presence1(J, Reason, Code, StateData)
|
send_kickban_presence1(J, Reason, Code, NewAffiliation, StateData)
|
||||||
end, LJIDs).
|
end, LJIDs).
|
||||||
|
|
||||||
send_kickban_presence1(UJID, Reason, Code, 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),
|
||||||
{N,D,R} = UJID,
|
|
||||||
Affiliation = get_affiliation(exmpp_jid:make(N,D,R), StateData),
|
|
||||||
SAffiliation = affiliation_to_binary(Affiliation),
|
SAffiliation = affiliation_to_binary(Affiliation),
|
||||||
lists:foreach(
|
lists:foreach(
|
||||||
fun({_LJID, Info}) ->
|
fun({_LJID, Info}) ->
|
||||||
|
Loading…
Reference in New Issue
Block a user