mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-02 12:07:28 +00:00
Transform MessageEventType and StateEventType into sealed interfaces to handle the Custom variant, also add missing variants
This commit is contained in:
committed by
Jorge Martin Espinosa
parent
0ed40c562d
commit
a8ffe46d99
+4
-4
@@ -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),
|
||||
)
|
||||
}
|
||||
|
||||
+4
-4
@@ -387,10 +387,10 @@ class SecurityAndPrivacyPresenterTest {
|
||||
return FakeRoomPermissions(
|
||||
canSendState = { eventType ->
|
||||
when (eventType) {
|
||||
StateEventType.ROOM_JOIN_RULES -> canChangeRoomAccess
|
||||
StateEventType.ROOM_HISTORY_VISIBILITY -> canChangeHistoryVisibility
|
||||
StateEventType.ROOM_ENCRYPTION -> canChangeEncryption
|
||||
StateEventType.ROOM_CANONICAL_ALIAS -> canChangeRoomVisibility
|
||||
StateEventType.RoomJoinRules -> canChangeRoomAccess
|
||||
StateEventType.RoomHistoryVisibility -> canChangeHistoryVisibility
|
||||
StateEventType.RoomEncryption -> canChangeEncryption
|
||||
StateEventType.RoomCanonicalAlias -> canChangeRoomVisibility
|
||||
else -> lambdaError()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user