Refactor userEventPermissions

This commit is contained in:
ganfra 2024-07-29 13:43:47 +02:00
parent 2605ddec7a
commit 6ad547833f
7 changed files with 41 additions and 24 deletions

View file

@ -56,6 +56,13 @@ fun MatrixRoom.canCall(updateKey: Long): State<Boolean> {
}
}
@Composable
fun MatrixRoom.canPinUnpin(updateKey: Long): State<Boolean> {
return produceState(initialValue = false, key1 = updateKey) {
value = canUserPinUnpin(sessionId).getOrElse { false }
}
}
@Composable
fun MatrixRoom.isOwnUserAdmin(): Boolean {
val roomInfo by roomInfoFlow.collectAsState(initial = null)