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()
|
return roomIds.orEmpty()
|
||||||
}
|
}
|
||||||
|
|
||||||
fun updateShieldForRoom(roomId: String, shield: RoomEncryptionTrustLevel) {
|
fun updateShieldForRoom(roomId: String, shield: RoomEncryptionTrustLevel?) {
|
||||||
monarchy.writeAsync { realm ->
|
monarchy.writeAsync { realm ->
|
||||||
val summary = RoomSummaryEntity.where(realm, roomId = roomId).findFirst()
|
val summary = RoomSummaryEntity.where(realm, roomId = roomId).findFirst()
|
||||||
summary?.roomEncryptionTrustLevel = shield
|
summary?.roomEncryptionTrustLevel = shield
|
||||||
|
|
|
@ -145,9 +145,13 @@ internal class OutgoingRequestsProcessor @Inject constructor(
|
||||||
|
|
||||||
private fun CoroutineScope.updateShields(olmMachine: OlmMachine, userIds: List<String>) = launch {
|
private fun CoroutineScope.updateShields(olmMachine: OlmMachine, userIds: List<String>) = launch {
|
||||||
cryptoSessionInfoProvider.getRoomsWhereUsersAreParticipating(userIds).forEach { roomId ->
|
cryptoSessionInfoProvider.getRoomsWhereUsersAreParticipating(userIds).forEach { roomId ->
|
||||||
val userGroup = cryptoSessionInfoProvider.getUserListForShieldComputation(roomId)
|
if (cryptoSessionInfoProvider.isRoomEncrypted(roomId)) {
|
||||||
val shield = computeShieldForGroup(olmMachine, userGroup)
|
val userGroup = cryptoSessionInfoProvider.getUserListForShieldComputation(roomId)
|
||||||
cryptoSessionInfoProvider.updateShieldForRoom(roomId, shield)
|
val shield = computeShieldForGroup(olmMachine, userGroup)
|
||||||
|
cryptoSessionInfoProvider.updateShieldForRoom(roomId, shield)
|
||||||
|
} else {
|
||||||
|
cryptoSessionInfoProvider.updateShieldForRoom(roomId, null)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue