From a05ed3641954c46bc3d9280c6599fd786fd88e01 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Fri, 12 Feb 2021 11:50:14 +0100 Subject: [PATCH] Mark contents created before user registration as read Resolves #3971 --- .../files/lib/system/visitTracker/VisitTracker.class.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/wcfsetup/install/files/lib/system/visitTracker/VisitTracker.class.php b/wcfsetup/install/files/lib/system/visitTracker/VisitTracker.class.php index 12a9483a85..744e08bcee 100644 --- a/wcfsetup/install/files/lib/system/visitTracker/VisitTracker.class.php +++ b/wcfsetup/install/files/lib/system/visitTracker/VisitTracker.class.php @@ -106,6 +106,11 @@ class VisitTracker extends SingletonFactory $lifetime = ($this->availableObjectTypes[$objectType]->lifetime) ?: self::DEFAULT_LIFETIME; $minimum = TIME_NOW - $lifetime; + if (WCF::getUser()->userID) { + // Mark everything before the registration date as read. + $minimum = \max($minimum, WCF::getUser()->registrationDate); + } + if (isset($this->userVisits[$objectTypeID])) { // double times the lifetime period for existing visit data; // equals 2 weeks for the default lifetime of 7 days -- 2.20.1