mirror of
https://gitlab.com/comunic/comunicapiv2
synced 2024-11-24 22:39:21 +00:00
Can mark a user as ready
This commit is contained in:
parent
3cae1220c3
commit
38858e956d
@ -170,6 +170,28 @@ export class CallsController {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Mark a user as ready to share its streams
|
||||
*
|
||||
* @param h Request handler
|
||||
*/
|
||||
public static async MarkUserReady(h: UserWebSocketRequestsHandler) {
|
||||
const callID = h.postCallId("callID");
|
||||
|
||||
h.wsClient.activeCalls.get(callID).ready = true;
|
||||
|
||||
// Notify all other users
|
||||
await UserWebSocketController.SendToSpecifcClients(
|
||||
(c) => c.activeCalls.has(callID) && c.userID != h.getUserId(),
|
||||
() => WsMessage.NoIDMessage("user_ready", {
|
||||
callID: callID,
|
||||
userID: h.getUserId()
|
||||
})
|
||||
)
|
||||
|
||||
h.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* Make the client leave the call
|
||||
*
|
||||
|
@ -42,4 +42,6 @@ export const UserWebSocketRoutes: UserWebSocketRoute[] = [
|
||||
{title: "calls/members", handler: (h) => CallsController.GetMembersList(h)},
|
||||
|
||||
{title: "calls/signal", handler: (h) => CallsController.OnClientSignal(h)},
|
||||
|
||||
{title: "calls/mark_ready", handler: (h) => CallsController.MarkUserReady(h)},
|
||||
]
|
Loading…
Reference in New Issue
Block a user