From c8553003d73bf47b90301b6748596647712b976a Mon Sep 17 00:00:00 2001 From: Tobias Fella Date: Fri, 27 Nov 2020 16:09:53 +0100 Subject: [PATCH] Only send a notification for events newer than one minute To prevent notification flood on startup A bit hacky, but good enough for now --- src/neochatroom.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/neochatroom.cpp b/src/neochatroom.cpp index 4b9f8198b..c33896afd 100644 --- a/src/neochatroom.cpp +++ b/src/neochatroom.cpp @@ -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; }