Moderation tweaks (#2548)

* Only allow admins to see the roles and permissions screen.

* Hide the selection checkbox on Admins when changing roles.

* Show an empty state for banned users.

* Add separate actions for ban and remove.

* Implement reset permissions and demote self alerts.

* Add tests for resetting permissions and demoting self.

* Add a warning when promoting someone to administrator.
This commit is contained in:
Doug
2024-03-11 14:19:53 +00:00
committed by GitHub
parent 9ce12e6e16
commit 71721f01b1
37 changed files with 411 additions and 104 deletions
@@ -586,7 +586,6 @@ class MockScreen: Identifiable {
name: "Room",
isEncrypted: true,
members: members,
memberForID: .mockMe,
canUserInvite: false))
let coordinator = RoomDetailsScreenCoordinator(parameters: .init(roomProxy: roomProxy,
clientProxy: ClientProxyMock(.init()),
@@ -609,7 +608,6 @@ class MockScreen: Identifiable {
isEncrypted: true,
canonicalAlias: "#mock:room.org",
members: members,
memberForID: .mockMe,
canUserInvite: false))
let coordinator = RoomDetailsScreenCoordinator(parameters: .init(roomProxy: roomProxy,
clientProxy: ClientProxyMock(.init()),
@@ -633,7 +631,6 @@ class MockScreen: Identifiable {
isEncrypted: true,
canonicalAlias: "#mock:room.org",
members: members,
memberForID: .mockMeAdmin,
canUserInvite: false))
let coordinator = RoomDetailsScreenCoordinator(parameters: .init(roomProxy: roomProxy,
clientProxy: ClientProxyMock(.init()),
@@ -654,7 +651,6 @@ class MockScreen: Identifiable {
name: "Room",
isEncrypted: true,
members: members,
memberForID: owner,
canUserInvite: true))
let coordinator = RoomDetailsScreenCoordinator(parameters: .init(roomProxy: roomProxy,
clientProxy: ClientProxyMock(.init()),
@@ -676,7 +672,6 @@ class MockScreen: Identifiable {
isDirect: true,
isEncrypted: true,
members: members,
memberForID: .mockMe,
canUserInvite: false))
let coordinator = RoomDetailsScreenCoordinator(parameters: .init(roomProxy: roomProxy,
clientProxy: ClientProxyMock(.init()),