Skip to content

Commit 0960e35

Browse files
Merge pull request #2010 from TheOneWithTheBraid/braid/hero-user-direct-chat
fix: priorize direct chat MXIDs over empty hero user list
2 parents af99197 + 4edae55 commit 0960e35

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/src/room.dart

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,8 +249,10 @@ class Room {
249249
}
250250

251251
final directChatMatrixID = this.directChatMatrixID;
252-
final heroes = summary.mHeroes ??
253-
(directChatMatrixID == null ? [] : [directChatMatrixID]);
252+
final heroes = summary.mHeroes ?? [];
253+
if (directChatMatrixID != null && heroes.isEmpty) {
254+
heroes.add(directChatMatrixID);
255+
}
254256
if (heroes.isNotEmpty) {
255257
final result = heroes
256258
.where(

0 commit comments

Comments
 (0)