/** * Set a new topic or clear it * * @uses Ajax */ public function actionTopic($roomId) { $this->filterRoomId($roomId); try { // are we allowed to enter? $this->user->canEnter($roomId); $topic = $this->request->getPost('topic'); $room = new Room(); $room->topic($roomId, $topic = $this->request->getPost('topic')); // message about it $time = mktime(); $message = new MessageSpeak($roomId, $time); $message->topic($roomId, $this->user->getShortName(), $topic); $this->renderJson($topic); } catch (UserNotAuthorizedException $e) { $this->renderJson('bye'); } }