Fixed online badge in quick reply sidebar
authorMarcel Werk <burntime@woltlab.com>
Mon, 5 Sep 2016 10:38:05 +0000 (12:38 +0200)
committerMarcel Werk <burntime@woltlab.com>
Mon, 5 Sep 2016 10:38:05 +0000 (12:38 +0200)
wcfsetup/install/files/lib/data/user/UserProfile.class.php
wcfsetup/install/files/lib/system/user/UserProfileHandler.class.php

index 9d1694108ba822407b12db7d7df969a5286ac469..7cdf6e74ae4ad74ae466e71694ec30e8cf847626 100644 (file)
@@ -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.
         * 
index 430c74d3a44b1bab9051876c2dde348afd887f9f..29afb3c3422f2e2564cf26a165c0f749a0fda50f 100644 (file)
@@ -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);
        }
        
        /**