-
Notifications
You must be signed in to change notification settings - Fork 109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Room admins can change user roles #2423
Conversation
📱 Scan the QR code below to install the build (arm64 only) for this PR. |
- Add a 'roles and permissions' option for each room. - Allow promoting users to admins, adding or removing moderators, and demote yourself if you're and admin.
99d8197
to
da4f77c
Compare
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some small remarks otherwise LGTM!
@@ -35,7 +35,25 @@ data class RoomMember( | |||
enum class Role { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Integrate values directly in the enum?
} | ||
val exitState: MutableState<AsyncAction<Unit>> = remember { mutableStateOf(AsyncAction.Uninitialized) } | ||
val saveState: MutableState<AsyncAction<Unit>> = remember { mutableStateOf(AsyncAction.Uninitialized) } | ||
val usersWithRole = produceState(initialValue = persistentListOf()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Create an extension method on room?
@@ -71,6 +71,9 @@ class RoomDetailsPresenter @Inject constructor( | |||
val leaveRoomState = leaveRoomPresenter.present() | |||
val canShowNotificationSettings = remember { mutableStateOf(false) } | |||
val roomInfo by room.roomInfoFlow.collectAsState(initial = null) | |||
val isUserAdmin by produceState(initialValue = false) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably be an extension method on room within the matrix-ui module.
Also there is no key given to produceState
so this won't be live? is it ok? maybe use roomInfo.userPowerLevels
as key?
Quality Gate passedIssues Measures |
Maestro failed twice by 2 unrelated emulator issues, yay. I hope third time's a charm 🤞 . |
Type of change
Content
Motivation and context
#2257
Screenshots / GIFs
In the PR.
Tests
Tested devices
Checklist