Only send a notification for events newer than one minute

To prevent notification flood on startup
A bit hacky, but good enough for now
This commit is contained in:
Tobias Fella
2020-11-27 16:09:53 +01:00
parent 550cef52d0
commit c8553003d7

View File

@@ -49,6 +49,9 @@ NeoChatRoom::NeoChatRoom(Connection *connection, QString roomId, JoinState joinS
return;
}
const RoomEvent *lastEvent = messageEvents().rbegin()->get();
if(lastEvent->originTimestamp() < QDateTime::currentDateTime().addSecs(-60)) {
return;
}
if (lastEvent->isStateEvent()) {
return;
}