Allow homeserver to disable encryption in Element Pro (#7198)

* Allow HS to disable encryption in Element Pro

Add `force_disable_e2ee` support in the Element well known retriever and cache to allow a homeserver to disable encrypted room creation and enabling encryption in an existing room in Element Pro clients

* Bump enterprise repo back to `main` branch
This commit is contained in:
Jorge Martin Espinosa
2026-07-15 13:29:16 +02:00
committed by GitHub
parent 03f3e8b3e0
commit 62cc7e0505
19 changed files with 97 additions and 9 deletions
@@ -126,7 +126,7 @@ class FakeMatrixClient(
private val getMapStyleUrlResult: () -> Result<String?> = { lambdaError() },
private val getDatabaseSizesLambda: () -> Result<SdkStoreSizes> = { lambdaError() },
private val resetWellKnownConfigLambda: () -> Result<Unit> = { lambdaError() },
override val contentScanner: ContentScanner? = null
override val contentScanner: ContentScanner? = null,
) : MatrixClient {
var setDisplayNameCalled: Boolean = false
private set
@@ -144,7 +144,7 @@ class FakeMatrixClient(
private val _userProfile: MutableStateFlow<MatrixUser> = MutableStateFlow(MatrixUser(sessionId, userDisplayName, userAvatarUrl))
override val userProfile: StateFlow<MatrixUser> = _userProfile
private var createRoomResult: Result<RoomId> = Result.success(A_ROOM_ID)
var createRoomResult: (CreateRoomParameters) -> Result<RoomId> = { Result.success(A_ROOM_ID) }
private var createDmResult: Result<RoomId> = Result.success(A_ROOM_ID)
private var findDmResult: Result<RoomId?> = Result.success(A_ROOM_ID)
private val getRoomResults = mutableMapOf<RoomId, BaseRoom>()
@@ -193,7 +193,7 @@ class FakeMatrixClient(
}
override suspend fun createRoom(createRoomParams: CreateRoomParameters): Result<RoomId> = simulateLongTask {
return createRoomResult
return createRoomResult(createRoomParams)
}
override suspend fun createDM(userId: UserId): Result<RoomId> = simulateLongTask {
@@ -297,7 +297,7 @@ class FakeMatrixClient(
// Mocks
fun givenCreateRoomResult(result: Result<RoomId>) {
createRoomResult = result
createRoomResult = { result }
}
fun givenCreateDmResult(result: Result<RoomId>) {