From 564ad4fa8f02c9a8980ca196acefa5bcc166f0b2 Mon Sep 17 00:00:00 2001 From: miruka Date: Fri, 16 Aug 2019 03:01:40 -0400 Subject: [PATCH] Fix invited/left rooms sorting --- src/python/models/items.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/python/models/items.py b/src/python/models/items.py index 4a9f2fb6..65f54928 100644 --- a/src/python/models/items.py +++ b/src/python/models/items.py @@ -43,9 +43,13 @@ class Room(ModelItem): def __lt__(self, other: "Room") -> bool: # Left rooms may still have an inviter_id, check left first. if self.left and not other.left: + return False + if other.left and not self.left: return True if other.inviter_id and not self.inviter_id: + return False + if self.inviter_id and not other.inviter_id: return True name = self.display_name or self.room_id