mirror of
https://github.com/wbbaddons/Tims-Chat.git
synced 2025-01-09 00:20:08 +00:00
Finally fixing ChatPageMenuItemProvider
This commit is contained in:
parent
c24402ec86
commit
966a4f57d3
@ -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
|
||||
));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user