diff --git a/file/lib/action/ChatLeaveAction.class.php b/file/lib/action/ChatLeaveAction.class.php index 0ee0516..bf30688 100644 --- a/file/lib/action/ChatLeaveAction.class.php +++ b/file/lib/action/ChatLeaveAction.class.php @@ -1,6 +1,7 @@ userData['roomID'] = \wcf\util\ChatUtil::readUserData('roomID'); $cache = chat\room\ChatRoom::getCache(); - if (!isset($cache[$this->userData['roomID']])) throw new \wcf\system\exception\IllegalLinkException(); + if (!isset($cache[$this->userData['roomID']])) throw new IllegalLinkException(); $this->room = $cache[$this->userData['roomID']]; if (!$this->room->canEnter()) throw new \wcf\system\exception\PermissionDeniedException(); diff --git a/file/lib/page/ChatCopyrightPage.class.php b/file/lib/page/ChatCopyrightPage.class.php index e3ba869..6f38943 100644 --- a/file/lib/page/ChatCopyrightPage.class.php +++ b/file/lib/page/ChatCopyrightPage.class.php @@ -1,5 +1,6 @@ room = $cache[$roomID]; if (!$this->room->canEnter()) throw new \wcf\system\exception\PermissionDeniedException(); diff --git a/file/lib/page/ChatRefreshRoomListPage.class.php b/file/lib/page/ChatRefreshRoomListPage.class.php index d4c8298..d53ad5a 100644 --- a/file/lib/page/ChatRefreshRoomListPage.class.php +++ b/file/lib/page/ChatRefreshRoomListPage.class.php @@ -2,6 +2,7 @@ namespace wcf\page; use \wcf\data\chat; use \wcf\system\cache\CacheHandler; +use \wcf\ystem\exception\IllegalLinkException; use \wcf\system\WCF; /** @@ -28,7 +29,17 @@ class ChatRefreshRoomListPage extends AbstractPage { * @see \wcf\page\AbstractPage::$neededPermissions */ public $neededPermissions = array(); + + /** + * the room the user current is in + * @var \wcf\data\chat\room\ChatRoom + */ public $room = null; + + /** + * all rooms in the current installation + * @var array<\wcf\data\chat\room\ChatRoom> + */ public $rooms = array(); /** @@ -62,7 +73,7 @@ public function readData() { $this->rooms = chat\room\ChatRoom::getCache(); $roomID = \wcf\util\ChatUtil::readUserData('roomID'); - if (!isset($this->rooms[$roomID])) throw new \wcf\system\exception\IllegalLinkException(); + if (!isset($this->rooms[$roomID])) throw new IllegalLinkException(); $this->room = $this->rooms[$roomID]; } @@ -76,6 +87,7 @@ public function show() { $json = array(); foreach ($this->rooms as $room) { if (!$room->canEnter()) continue; + $json[] = array( 'title' => WCF::getLanguage()->get($room->title), 'link' => \wcf\system\request\LinkHandler::getInstance()->getLink('Chat', array(