mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-04 01:20:12 +00:00
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:
@@ -178,7 +178,7 @@ class RoomDetailsScreenViewModel: RoomDetailsScreenViewModelType, RoomDetailsScr
|
||||
state.canEditRoomTopic = await roomProxy.canUser(userID: roomProxy.ownUserID, sendStateEvent: .roomTopic) == .success(true)
|
||||
state.canEditRoomAvatar = await roomProxy.canUser(userID: roomProxy.ownUserID, sendStateEvent: .roomAvatar) == .success(true)
|
||||
if appSettings.roomModerationEnabled {
|
||||
state.canEditRolesOrPermissions = await roomProxy.canUser(userID: roomProxy.ownUserID, sendStateEvent: .roomPowerLevels) == .success(true)
|
||||
state.canEditRolesOrPermissions = await roomProxy.suggestedRole(for: roomProxy.ownUserID) == .success(.administrator)
|
||||
}
|
||||
state.canInviteUsers = await canInviteUsers
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user