/** * User submits a message * * @return array data sent to client as JSON */ public function action_add() { if (!$this->auth->acl_get('u_mchat_use') || !check_form_key('mchat', -1)) { throw new \phpbb\exception\http_exception(403, 'MCHAT_NOACCESS'); } if ($this->functions_mchat->mchat_is_user_flooding()) { throw new \phpbb\exception\http_exception(400, 'MCHAT_NOACCESS'); } $message = $this->request->variable('message', '', true); // User can choose the autocapitalization if ($this->user->data['user_mchat_capitalization']) { $message = utf8_ucfirst($message); } $sql_ary = $this->process_message($message, array('user_id' => $this->user->data['user_id'], 'user_ip' => $this->user->data['session_ip'], 'message_time' => time())); $this->functions_mchat->mchat_action('add', $sql_ary); /** * Event render_helper_add * * @event dmzx.mchat.core.render_helper_add * @since 0.1.2 */ $this->dispatcher->dispatch('dmzx.mchat.core.render_helper_add'); return $this->action_refresh(); }