* @package timwolla.wcf.chat * @subpackage system.menu.page */ class ChatPageMenuItemProvider extends DefaultPageMenuItemProvider { /** * Hides the button when there is no valid room * * @see wcf\system\menu\page\PageMenuItemProvider::isVisible() */ public function isVisible() { // guests are not supported if (!\wcf\system\WCF::getUser()->userID) return false; try { \wcf\data\chat\room\ChatRoom::getCache()->seek(0); return true; } catch (\OutOfBoundsException $e) { return false; } } }