Update shield logic for DM

This commit is contained in:
Valere 2020-03-26 14:26:34 +01:00
parent 3bb5e127d6
commit 5244612ef6
2 changed files with 10 additions and 1 deletions

View File

@ -7,6 +7,7 @@ Features ✨:
Improvements 🙌:
- Verification DM / Handle concurrent .start after .ready (#794)
- CrossSigning / Update Shield Logic for DM (#963)
Bugfix 🐛:
- Missing avatar/displayname after verification request message (#841)

View File

@ -161,7 +161,15 @@ internal class RoomSummaryUpdater @Inject constructor(
roomSummaryEntity.otherMemberIds.clear()
roomSummaryEntity.otherMemberIds.addAll(otherRoomMembers)
if (roomSummaryEntity.isEncrypted) {
eventBus.post(SessionToCryptoRoomMembersUpdate(roomId, roomSummaryEntity.otherMemberIds.toList() + userId))
// 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 1:1 and group DM rooms, all other users (i.e. excluding yourself) are considered when decorating a room
val listToCheck = if (roomSummaryEntity.isDirect) {
roomSummaryEntity.otherMemberIds.toList()
} else {
roomSummaryEntity.otherMemberIds.toList() + userId
}
eventBus.post(SessionToCryptoRoomMembersUpdate(roomId, listToCheck))
}
}
}