Sort rooms by last event date again

This commit is contained in:
miruka 2019-08-16 12:19:43 -04:00
parent 2bb3952225
commit 9ca66b6044

View File

@ -47,10 +47,17 @@ class Room(ModelItem):
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
if other.inviter_id and not self.inviter_id:
return False
if self.last_event and other.last_event:
return self.last_event["date"] > other.last_event["date"]
if self.last_event and not other.last_event:
return True
if other.last_event and not self.last_event:
return False
name = self.display_name or self.room_id
other_name = other.display_name or other.room_id