From 4edae55852c67fafa2c82646fff0c3a8162d5dbc Mon Sep 17 00:00:00 2001 From: The one with the braid Date: Sat, 1 Feb 2025 13:34:15 +0100 Subject: [PATCH] fix: priorize direct chat users over empty hero user list Signed-off-by: The one with the braid --- lib/src/room.dart | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/src/room.dart b/lib/src/room.dart index ef504c87..a5600619 100644 --- a/lib/src/room.dart +++ b/lib/src/room.dart @@ -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(