sendResponse(); } public static function startSession($args){ $path = @$_POST['path']; \OCP\JSON::checkLoggedIn(); $uid = \OCP\User::getUser(); $officeView = View::initOfficeView($uid); if (!$officeView->file_exists($path)){ $genesisPath = View::storeDocument($uid, $path); } else { $genesisPath = $path; } if ($genesisPath){ $session = Session::getSessionByPath($uid, $genesisPath); if (!$session){ $hash = View::getHashByGenesis($uid, $genesisPath); $session = Session::addSession($genesisPath, $hash); } \OCP\JSON::success($session); exit(); } \OCP\JSON::error(); } public static function joinSession($args){ $esId = @$args['es_id']; \OCP\JSON::checkLoggedIn(); if ($esId){ $session = Session::getSession($esId); \OCP\JSON::success($session); exit(); } \OCP\JSON::error(); } }