From: Tim Düsterhus Date: Fri, 12 Feb 2021 10:50:14 +0000 (+0100) Subject: Mark contents created before user registration as read X-Git-Tag: 5.4.0_Alpha_1~277^2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=a05ed3641954c46bc3d9280c6599fd786fd88e01;p=GitHub%2FWoltLab%2FWCF.git Mark contents created before user registration as read Resolves #3971 --- 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