Fix invited/left rooms sorting

This commit is contained in:
miruka 2019-08-16 03:01:40 -04:00
parent 653934be71
commit 564ad4fa8f

View File

@ -43,9 +43,13 @@ class Room(ModelItem):
def __lt__(self, other: "Room") -> bool: def __lt__(self, other: "Room") -> bool:
# Left rooms may still have an inviter_id, check left first. # Left rooms may still have an inviter_id, check left first.
if self.left and not other.left: if self.left and not other.left:
return False
if other.left and not self.left:
return True return True
if other.inviter_id and not self.inviter_id: if other.inviter_id and not self.inviter_id:
return False
if self.inviter_id and not other.inviter_id:
return True return True
name = self.display_name or self.room_id name = self.display_name or self.room_id