fix: priorize direct chat users over empty hero user list

Signed-off-by: The one with the braid <info@braid.business>
This commit is contained in:
The one with the braid 2025-02-01 13:34:15 +01:00
parent af9919786a
commit 4edae55852
No known key found for this signature in database
GPG Key ID: 79D2235BC19FF56A
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(