From a2f27f956a635e2c5138b6b2a61bd45566921805 Mon Sep 17 00:00:00 2001 From: Repo <47093363+Titian3@users.noreply.github.com> Date: Sat, 3 Aug 2024 06:58:00 +1200 Subject: [PATCH] Fix Bwoink Player sorting again.... (#30580) Keep players that have had messages in the round at the top --- .../Administration/UI/Bwoink/BwoinkControl.xaml.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Content.Client/Administration/UI/Bwoink/BwoinkControl.xaml.cs b/Content.Client/Administration/UI/Bwoink/BwoinkControl.xaml.cs index 18aa02e9d6..dd8e3e2212 100644 --- a/Content.Client/Administration/UI/Bwoink/BwoinkControl.xaml.cs +++ b/Content.Client/Administration/UI/Bwoink/BwoinkControl.xaml.cs @@ -92,13 +92,18 @@ namespace Content.Client.Administration.UI.Bwoink if (a.IsPinned != b.IsPinned) return a.IsPinned ? -1 : 1; - // First, sort by unread. Any chat with unread messages appears first. We just sort based on unread - // status, not number of unread messages, so that more recent unread messages take priority. + // First, sort by unread. Any chat with unread messages appears first. var aUnread = ach.Unread > 0; var bUnread = bch.Unread > 0; if (aUnread != bUnread) return aUnread ? -1 : 1; + // Sort by recent messages during the current round. + var aRecent = a.ActiveThisRound && ach.LastMessage != DateTime.MinValue; + var bRecent = b.ActiveThisRound && bch.LastMessage != DateTime.MinValue; + if (aRecent != bRecent) + return aRecent ? -1 : 1; + // Next, sort by connection status. Any disconnected players are grouped towards the end. if (a.Connected != b.Connected) return a.Connected ? -1 : 1; -- 2.52.0