diff --git a/file/lib/system/menu/page/ChatPageMenuItemProvider.class.php b/file/lib/system/menu/page/ChatPageMenuItemProvider.class.php index 93d0c37..3f44ff4 100644 --- a/file/lib/system/menu/page/ChatPageMenuItemProvider.class.php +++ b/file/lib/system/menu/page/ChatPageMenuItemProvider.class.php @@ -24,7 +24,9 @@ public function isVisible() { if (!\wcf\system\WCF::getUser()->userID) return false; try { - ChatRoom::getCache()->seek(0); + $cache = ChatRoom::getCache(); + $cache->seek(0); + $this->room = $cache->search($cache->key()); return true; } catch (\OutOfBoundsException $e) { @@ -38,9 +40,8 @@ public function isVisible() { * @see \wcf\system\menu\page\PageMenuItemProvider::getLink() */ public function getLink() { - if (!$this->isVisible()) return parent::getLink(); - return \wcf\util\HeaderUtil::redirect(\wcf\system\request\LinkHandler::getInstance()->getLink('Chat', array( - 'object' => ChatRoom::getCache()->search(ChatRoom::getCache()->key()) - ))); + return \wcf\system\request\LinkHandler::getInstance()->getLink('Chat', array( + 'object' => $this->room + )); } }