fix: rely only on RoomMember Role values instead of using the powerLevel.
This commit is contained in:
parent
f265a47243
commit
be90afe22b
10 changed files with 84 additions and 122 deletions
|
|
@ -96,10 +96,7 @@ class LeaveRoomPresenter(
|
|||
} else {
|
||||
val hasPrivilegedCreatorRole = roomInfoFlow.value.privilegedCreatorRole
|
||||
if (!hasPrivilegedCreatorRole) return false
|
||||
|
||||
val creators = usersWithRole(RoomMember.Role.Owner(isCreator = true)).first()
|
||||
val superAdmins = usersWithRole(RoomMember.Role.Owner(isCreator = false)).first()
|
||||
val owners = creators + superAdmins
|
||||
val owners = usersWithRole { role -> role is RoomMember.Role.Owner }.first()
|
||||
return owners.size == 1 && owners.first().userId == sessionId
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue