is_chat_blocked_by_exercises()) { //Disconnecting the user $chat->set_user_status(0); exit; } switch ($action) { case 'chatheartbeat': $chat->heartbeat(); break; case 'closechat': $chat->close(); break; case 'sendchat': $chat->send(api_get_user_id(), $to_user_id, $message); break; case 'startchatsession': $chat->start_session(); break; case 'set_status': $status = isset($_REQUEST['status']) ? intval($_REQUEST['status']) : 0; $chat->set_user_status($status); break; default: echo ''; } exit;