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:
@@ -49,6 +49,9 @@ NeoChatRoom::NeoChatRoom(Connection *connection, QString roomId, JoinState joinS
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const RoomEvent *lastEvent = messageEvents().rbegin()->get();
|
const RoomEvent *lastEvent = messageEvents().rbegin()->get();
|
||||||
|
if(lastEvent->originTimestamp() < QDateTime::currentDateTime().addSecs(-60)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (lastEvent->isStateEvent()) {
|
if (lastEvent->isStateEvent()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user