Join GitHub today
Fix power levels being incorrectly set in old and new rooms after a room upgrade #6633
Fixes a bug introduced in #6237 where in which a moderator in a room upgrades the room, the following oddities occur:
Turns out the problem was due to modifying
Additionally, the way we downgrade the Mod back from an Admin to a Mod in the new room, is by simply applying the old room's power levels once again. But, since we're using the modified power levels object, which had the Mod as an Admin, the Mod remains an Admin in the new room.
Performing a deepcopy instead solves both of these problems.
I am not sure this is a good idea, because this is currently the only method to get control of IRC rooms that are managed entirely by e.g. matrix-appservice-irc, matrix-org/matrix-appservice-irc#408.
Also if PL100 was required for upgrading rooms, only the appservice would be able to do that and I am not certain it's a good idea.
@Mikaela you can still manually upgrade rooms and set whatever power levels you like when creating the new room: https://gist.github.com/turt2live/a99c8e794d6115d4ddfaadb72aabf063