From 925f504a147624c2b1432feb87d449143658041e Mon Sep 17 00:00:00 2001 From: Marcel Werk Date: Mon, 5 Sep 2016 12:38:05 +0200 Subject: [PATCH] Fixed online badge in quick reply sidebar --- .../install/files/lib/data/user/UserProfile.class.php | 9 +++++++++ .../files/lib/system/user/UserProfileHandler.class.php | 2 ++ 2 files changed, 11 insertions(+) diff --git a/wcfsetup/install/files/lib/data/user/UserProfile.class.php b/wcfsetup/install/files/lib/data/user/UserProfile.class.php index 9d1694108b..7cdf6e74ae 100644 --- a/wcfsetup/install/files/lib/data/user/UserProfile.class.php +++ b/wcfsetup/install/files/lib/data/user/UserProfile.class.php @@ -790,6 +790,15 @@ class UserProfile extends DatabaseObjectDecorator implements ITitledLinkObject { return $this->getDecoratedObject()->getTitle(); } + /** + * Sets the session-based last activity time. + * + * @param integer $timestamp + */ + public function setSessionLastActivityTime($timestamp) { + $this->object->data['sessionLastActivityTime'] = $timestamp; + } + /** * Returns an "empty" user profile object for a guest with the given username. * diff --git a/wcfsetup/install/files/lib/system/user/UserProfileHandler.class.php b/wcfsetup/install/files/lib/system/user/UserProfileHandler.class.php index 430c74d3a4..29afb3c342 100644 --- a/wcfsetup/install/files/lib/system/user/UserProfileHandler.class.php +++ b/wcfsetup/install/files/lib/system/user/UserProfileHandler.class.php @@ -27,6 +27,7 @@ class UserProfileHandler extends SingletonFactory { */ protected function init() { $this->userProfile = new UserProfile(WCF::getUser()); + $this->userProfile->setSessionLastActivityTime(WCF::getSession()->lastActivityTime); } /** @@ -56,6 +57,7 @@ class UserProfileHandler extends SingletonFactory { */ public function reloadUserProfile() { $this->userProfile = new UserProfile(new User($this->userID)); + $this->userProfile->setSessionLastActivityTime(WCF::getSession()->lastActivityTime); } /** -- 2.20.1