Exclude yourself when decorating rooms which are direct or don't have more than 2 users.

This commit is contained in:
Onuray Sahin 2020-11-10 17:17:05 +03:00
parent 0753ba3495
commit a2a2015af6
2 changed files with 3 additions and 2 deletions

View file

@ -9,6 +9,7 @@ Improvements 🙌:
Bugfix 🐛:
- Fix issue when updating the avatar of a room
- Exclude yourself when decorating rooms which are direct or don't have more than 2 users (#2370)
Translations 🗣:
-

View file

@ -241,9 +241,9 @@ internal class UpdateTrustWorker(context: Context,
private fun computeRoomShield(activeMemberUserIds: List<String>, roomSummaryEntity: RoomSummaryEntity): RoomEncryptionTrustLevel {
Timber.d("## CrossSigning - computeRoomShield ${roomSummaryEntity.roomId} -> $activeMemberUserIds")
// The set of “all users” depends on the type of room:
// For regular / topic rooms, all users including yourself, are considered when decorating a room
// For regular / topic rooms which have more than 2 members (including yourself) are considered when decorating a room
// For 1:1 and group DM rooms, all other users (i.e. excluding yourself) are considered when decorating a room
val listToCheck = if (roomSummaryEntity.isDirect) {
val listToCheck = if (roomSummaryEntity.isDirect || activeMemberUserIds.size <= 2) {
activeMemberUserIds.filter { it != myUserId }
} else {
activeMemberUserIds