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);
_ ->
SD1 = set_affiliation(JID, none, SD),
send_update_presence(JID, Reason, SD1, SD),
maybe_send_affiliation(JID, none, SD1),
SD1
SD2 = case (SD1#state.config)#config.moderated of
true -> set_role(JID, visitor, SD1);
false -> set_role(JID, participant, SD1)
end,
send_update_presence(JID, Reason, SD2, SD),
maybe_send_affiliation(JID, none, SD2),
SD2
end;
{JID, affiliation, outcast, Reason} ->
send_kickban_presence(UJID, JID, Reason, 301, outcast, SD),

View File

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