From 5244612ef6e28bdde43915d15277498dab82af03 Mon Sep 17 00:00:00 2001 From: Valere Date: Thu, 26 Mar 2020 14:26:34 +0100 Subject: [PATCH] Update shield logic for DM --- CHANGES.md | 1 + .../internal/session/room/RoomSummaryUpdater.kt | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 0cea91ed5b..2f18920b0a 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -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) diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/room/RoomSummaryUpdater.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/room/RoomSummaryUpdater.kt index 17541de9aa..f4886c72da 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/room/RoomSummaryUpdater.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/room/RoomSummaryUpdater.kt @@ -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)) } } }