diff --git a/file/lib/page/ChatPage.class.php b/file/lib/page/ChatPage.class.php index e2ce651..307c681 100644 --- a/file/lib/page/ChatPage.class.php +++ b/file/lib/page/ChatPage.class.php @@ -173,16 +173,21 @@ public function readRoom() { if ($this->roomID === 0) { // no room given - $room = reset($this->rooms); - if ($room === null) { - // no valid room found - throw new exception\IllegalLinkException(); + if (CHAT_FORCE_ROOM_SELECT) { + return; + } + else { + $room = reset($this->rooms); + if ($room === null) { + // no valid room found + throw new exception\IllegalLinkException(); + } + // redirect to first chat-room + \wcf\util\HeaderUtil::redirect(\wcf\system\request\LinkHandler::getInstance()->getLink('Chat', array( + 'object' => $room + ))); + exit; } - // redirect to first chat-room - \wcf\util\HeaderUtil::redirect(\wcf\system\request\LinkHandler::getInstance()->getLink('Chat', array( - 'object' => $room - ))); - exit; } if (!isset($this->rooms[$this->roomID])) throw new exception\IllegalLinkException(); diff --git a/file/lib/system/menu/page/ChatPageMenuItemProvider.class.php b/file/lib/system/menu/page/ChatPageMenuItemProvider.class.php index 78c6f3e..bd3bcd3 100644 --- a/file/lib/system/menu/page/ChatPageMenuItemProvider.class.php +++ b/file/lib/system/menu/page/ChatPageMenuItemProvider.class.php @@ -44,6 +44,8 @@ public function isVisible() { * @see \wcf\system\menu\page\PageMenuItemProvider::getLink() */ public function getLink() { + if (CHAT_FORCE_ROOM_SELECT) return parent::getLink(); + return \wcf\system\request\LinkHandler::getInstance()->getLink('Chat', array( 'application' => 'chat', 'object' => $this->room, diff --git a/option.xml b/option.xml index 8dbebeb..347536f 100644 --- a/option.xml +++ b/option.xml @@ -18,6 +18,11 @@ boolean 1 +