зеркало из https://github.com/nextcloud/spreed.git
Clarify leave methods...
Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Родитель
b274441c61
Коммит
f0b4517bd3
|
@ -70,7 +70,7 @@ return [
|
|||
],
|
||||
],
|
||||
[
|
||||
'name' => 'Call#joinRoom',
|
||||
'name' => 'Call#joinCall',
|
||||
'url' => '/api/{apiVersion}/room/{token}/join',
|
||||
'verb' => 'POST',
|
||||
'requirements' => [
|
||||
|
@ -88,7 +88,7 @@ return [
|
|||
],
|
||||
],
|
||||
[
|
||||
'name' => 'Call#leave',
|
||||
'name' => 'Call#leaveCall',
|
||||
'url' => '/api/{apiVersion}/leave',
|
||||
'verb' => 'DELETE',
|
||||
'requirements' => ['apiVersion' => 'v1'],
|
||||
|
@ -143,7 +143,7 @@ return [
|
|||
],
|
||||
],
|
||||
[
|
||||
'name' => 'Room#leaveRoom',
|
||||
'name' => 'Room#removeSelfFromRoom',
|
||||
'url' => '/api/{apiVersion}/room/{roomId}',
|
||||
'verb' => 'DELETE',
|
||||
'requirements' => [
|
||||
|
|
|
@ -273,25 +273,6 @@ class CallController extends OCSController {
|
|||
return new DataResponse($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* @PublicPage
|
||||
*
|
||||
* @param string $token
|
||||
* @return DataResponse
|
||||
*/
|
||||
public function ping($token) {
|
||||
try {
|
||||
$room = $this->manager->getRoomForParticipantByToken($token, $this->userId);
|
||||
} catch (RoomNotFoundException $e) {
|
||||
return new DataResponse([], Http::STATUS_NOT_FOUND);
|
||||
}
|
||||
|
||||
$sessionId = $this->session->get('spreed-session');
|
||||
$room->ping($this->userId, $sessionId, time());
|
||||
|
||||
return new DataResponse();
|
||||
}
|
||||
|
||||
/**
|
||||
* @PublicPage
|
||||
* @UseSession
|
||||
|
@ -299,7 +280,7 @@ class CallController extends OCSController {
|
|||
* @param string $token
|
||||
* @return DataResponse
|
||||
*/
|
||||
public function joinRoom($token) {
|
||||
public function joinCall($token) {
|
||||
try {
|
||||
$room = $this->manager->getRoomForParticipantByToken($token, $this->userId);
|
||||
} catch (RoomNotFoundException $e) {
|
||||
|
@ -325,13 +306,32 @@ class CallController extends OCSController {
|
|||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @PublicPage
|
||||
*
|
||||
* @param string $token
|
||||
* @return DataResponse
|
||||
*/
|
||||
public function ping($token) {
|
||||
try {
|
||||
$room = $this->manager->getRoomForParticipantByToken($token, $this->userId);
|
||||
} catch (RoomNotFoundException $e) {
|
||||
return new DataResponse([], Http::STATUS_NOT_FOUND);
|
||||
}
|
||||
|
||||
$sessionId = $this->session->get('spreed-session');
|
||||
$room->ping($this->userId, $sessionId, time());
|
||||
|
||||
return new DataResponse();
|
||||
}
|
||||
|
||||
/**
|
||||
* @PublicPage
|
||||
* @UseSession
|
||||
*
|
||||
* @return DataResponse
|
||||
*/
|
||||
public function leave() {
|
||||
public function leaveCall() {
|
||||
if ($this->userId !== null) {
|
||||
$this->manager->disconnectUserFromAllRooms($this->userId);
|
||||
} else {
|
||||
|
|
|
@ -238,7 +238,7 @@ class RoomController extends OCSController {
|
|||
* @param int $roomId
|
||||
* @return DataResponse
|
||||
*/
|
||||
public function leaveRoom($roomId) {
|
||||
public function removeSelfFromRoom($roomId) {
|
||||
try {
|
||||
$room = $this->manager->getRoomForParticipant($roomId, $this->userId);
|
||||
} catch (RoomNotFoundException $e) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче