зеркало из https://github.com/nextcloud/spreed.git
Add token to the leave call request as well
Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Родитель
7c8441c793
Коммит
0d455abcee
|
@ -74,9 +74,12 @@ return [
|
|||
],
|
||||
[
|
||||
'name' => 'Call#leaveCall',
|
||||
'url' => '/api/{apiVersion}/call',
|
||||
'url' => '/api/{apiVersion}/call/{token}',
|
||||
'verb' => 'DELETE',
|
||||
'requirements' => ['apiVersion' => 'v1'],
|
||||
'requirements' => [
|
||||
'apiVersion' => 'v1',
|
||||
'token' => '^[a-z0-9]{4,30}$',
|
||||
],
|
||||
],
|
||||
|
||||
[
|
||||
|
|
|
@ -127,8 +127,13 @@
|
|||
});
|
||||
},
|
||||
leaveAllRooms: function() {
|
||||
var token = OCA.SpreedMe.Rooms.currentRoom();
|
||||
if (!token) {
|
||||
return;
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
url: OC.linkToOCS('apps/spreed/api/v1/call', 2),
|
||||
url: OC.linkToOCS('apps/spreed/api/v1/call', 2) + token,
|
||||
method: 'DELETE',
|
||||
async: false
|
||||
});
|
||||
|
|
|
@ -163,10 +163,12 @@ class CallController extends OCSController {
|
|||
* @PublicPage
|
||||
* @UseSession
|
||||
*
|
||||
* @param string $token
|
||||
* @return DataResponse
|
||||
*/
|
||||
public function leaveCall() {
|
||||
public function leaveCall($token) {
|
||||
if ($this->userId !== null) {
|
||||
// TODO: Currently we ignore $token, should be fixed at some point
|
||||
$this->manager->disconnectUserFromAllRooms($this->userId);
|
||||
} else {
|
||||
$sessionId = $this->session->get('spreed-session');
|
||||
|
|
Загрузка…
Ссылка в новой задаче