Merge pull request #2010 from TheOneWithTheBraid/braid/hero-user-direct-chat

fix: priorize direct chat MXIDs over empty hero user list
This commit is contained in:
Karthikeyan S 2025-02-01 19:23:27 +05:30 committed by GitHub
commit 0960e350db
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 2 deletions

View File

@ -249,8 +249,10 @@ class Room {
}
final directChatMatrixID = this.directChatMatrixID;
final heroes = summary.mHeroes ??
(directChatMatrixID == null ? [] : [directChatMatrixID]);
final heroes = summary.mHeroes ?? [];
if (directChatMatrixID != null && heroes.isEmpty) {
heroes.add(directChatMatrixID);
}
if (heroes.isNotEmpty) {
final result = heroes
.where(