25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-12-24 17:29:28 +01:00

Apply default role after revoking admin affiliation (#3023)

This commit is contained in:
Badlop 2019-09-17 10:41:27 +02:00
parent d8433d1644
commit fd4c5edc23
2 changed files with 8 additions and 4 deletions

View File

@ -2916,9 +2916,13 @@ process_item_change(Item, SD, UJID) ->
set_role(JID, none, SD1); set_role(JID, none, SD1);
_ -> _ ->
SD1 = set_affiliation(JID, none, SD), SD1 = set_affiliation(JID, none, SD),
send_update_presence(JID, Reason, SD1, SD), SD2 = case (SD1#state.config)#config.moderated of
maybe_send_affiliation(JID, none, SD1), true -> set_role(JID, visitor, SD1);
SD1 false -> set_role(JID, participant, SD1)
end,
send_update_presence(JID, Reason, SD2, SD),
maybe_send_affiliation(JID, none, SD2),
SD2
end; end;
{JID, affiliation, outcast, Reason} -> {JID, affiliation, outcast, Reason} ->
send_kickban_presence(UJID, JID, Reason, 301, outcast, SD), send_kickban_presence(UJID, JID, Reason, 301, outcast, SD),

View File

@ -784,7 +784,7 @@ change_affiliation_master(Config) ->
#muc_item{affiliation = Aff} -> #muc_item{affiliation = Aff} ->
ok ok
end end
end, [{member, participant, available}, {none, participant, available}, end, [{member, participant, available}, {none, visitor, available},
{admin, moderator, available}, {owner, moderator, available}, {admin, moderator, available}, {owner, moderator, available},
{outcast, none, unavailable}]), {outcast, none, unavailable}]),
ok = leave(Config), ok = leave(Config),