Fix: ER showing shields in clear rooms
This commit is contained in:
parent
bfe6207a63
commit
4766bc709d
|
@ -100,7 +100,7 @@ internal class CryptoSessionInfoProvider @Inject constructor(
|
|||
return roomIds.orEmpty()
|
||||
}
|
||||
|
||||
fun updateShieldForRoom(roomId: String, shield: RoomEncryptionTrustLevel) {
|
||||
fun updateShieldForRoom(roomId: String, shield: RoomEncryptionTrustLevel?) {
|
||||
monarchy.writeAsync { realm ->
|
||||
val summary = RoomSummaryEntity.where(realm, roomId = roomId).findFirst()
|
||||
summary?.roomEncryptionTrustLevel = shield
|
||||
|
|
|
@ -145,9 +145,13 @@ internal class OutgoingRequestsProcessor @Inject constructor(
|
|||
|
||||
private fun CoroutineScope.updateShields(olmMachine: OlmMachine, userIds: List<String>) = launch {
|
||||
cryptoSessionInfoProvider.getRoomsWhereUsersAreParticipating(userIds).forEach { roomId ->
|
||||
val userGroup = cryptoSessionInfoProvider.getUserListForShieldComputation(roomId)
|
||||
val shield = computeShieldForGroup(olmMachine, userGroup)
|
||||
cryptoSessionInfoProvider.updateShieldForRoom(roomId, shield)
|
||||
if (cryptoSessionInfoProvider.isRoomEncrypted(roomId)) {
|
||||
val userGroup = cryptoSessionInfoProvider.getUserListForShieldComputation(roomId)
|
||||
val shield = computeShieldForGroup(olmMachine, userGroup)
|
||||
cryptoSessionInfoProvider.updateShieldForRoom(roomId, shield)
|
||||
} else {
|
||||
cryptoSessionInfoProvider.updateShieldForRoom(roomId, null)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue