1
0
mirror of https://gitlab.com/comunic/comunicapiv2 synced 2025-09-20 14:18:47 +00:00

Forward signals for web app to rtc proxy

This commit is contained in:
2020-04-11 09:40:00 +02:00
parent 18dbc6fd9f
commit 2e6461c34a
4 changed files with 53 additions and 1 deletions

View File

@@ -80,4 +80,20 @@ export class UserWebSocketRequestsHandler extends BaseRequestsHandler {
return convID;
}
/**
* Get the ID of a peer of a call included in the WebSocket request
*
* @param callID Target call ID
* @param name The name of the POST field
*/
public postCallPeerID(callID: number, name: string) : number{
const peerID = this.postInt(name);
if(peerID != this.getUserId() && UserWebSocketController.active_clients.find(
(e) => e.userID == peerID && e.activeCalls.has(callID)) === undefined)
this.error(401, "This peer is not a member of the call!");
return peerID;
}
}