From 6af1c0e27cdfc708d1a64c1900394ef5b232939e Mon Sep 17 00:00:00 2001 From: miruka Date: Mon, 13 May 2019 13:20:39 -0400 Subject: [PATCH] Fix history events overwriting real lastEventDate --- harmonyqml/backend/signal_manager.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/harmonyqml/backend/signal_manager.py b/harmonyqml/backend/signal_manager.py index 54aabe3d..f2b6c61d 100644 --- a/harmonyqml/backend/signal_manager.py +++ b/harmonyqml/backend/signal_manager.py @@ -272,6 +272,11 @@ class SignalManager(QObject): ) -> None: for categ in self.backend.accounts[user_id].roomCategories: if room_id in categ.rooms: + + last = categ.rooms[room_id].lastEventDateTime + if last and last > event.dateTime: + continue + # Use setProperty to make sure to trigger model changed signals categ.rooms.setProperty( room_id, "lastEventDateTime", event.dateTime