From f3aa9f0c5f64a96fffd4949943729b706c300830 Mon Sep 17 00:00:00 2001 From: miruka Date: Thu, 16 Apr 2020 13:59:31 -0400 Subject: [PATCH] Sort rooms with mentions, then unreads first --- src/backend/models/items.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/backend/models/items.py b/src/backend/models/items.py index 71e0dc0e..3063cf56 100644 --- a/src/backend/models/items.py +++ b/src/backend/models/items.py @@ -96,11 +96,15 @@ class Room(ModelItem): return ( self.left, other.inviter_id, + other.mentions, + other.unreads, other.last_event_date, (self.display_name or self.id).lower(), ) < ( other.left, self.inviter_id, + self.mentions, + self.unreads, self.last_event_date, (other.display_name or other.id).lower(), )