Transform MessageEventType and StateEventType into sealed interfaces to handle the Custom variant, also add missing variants

This commit is contained in:
Jorge Martín 2025-12-22 10:09:37 +01:00 committed by Jorge Martin Espinosa
parent 0ed40c562d
commit a8ffe46d99
16 changed files with 230 additions and 164 deletions

View file

@ -44,9 +44,9 @@ data class SecurityAndPrivacyPermissions(
fun RoomPermissions.securityAndPrivacyPermissions(): SecurityAndPrivacyPermissions {
return SecurityAndPrivacyPermissions(
canChangeRoomAccess = canOwnUserSendState(StateEventType.ROOM_JOIN_RULES),
canChangeHistoryVisibility = canOwnUserSendState(StateEventType.ROOM_HISTORY_VISIBILITY),
canChangeEncryption = canOwnUserSendState(StateEventType.ROOM_ENCRYPTION),
canChangeRoomVisibility = canOwnUserSendState(StateEventType.ROOM_CANONICAL_ALIAS),
canChangeRoomAccess = canOwnUserSendState(StateEventType.RoomJoinRules),
canChangeHistoryVisibility = canOwnUserSendState(StateEventType.RoomHistoryVisibility),
canChangeEncryption = canOwnUserSendState(StateEventType.RoomEncryption),
canChangeRoomVisibility = canOwnUserSendState(StateEventType.RoomCanonicalAlias),
)
}