mirror of
				https://gitlab.com/comunic/comunicapiv2
				synced 2025-11-04 03:24:04 +00:00 
			
		
		
		
	Can mark a user as ready
This commit is contained in:
		@@ -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
 | 
						 * Make the client leave the call
 | 
				
			||||||
	 * 
 | 
						 * 
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -42,4 +42,6 @@ export const UserWebSocketRoutes: UserWebSocketRoute[] = [
 | 
				
			|||||||
	{title: "calls/members", handler: (h) => CallsController.GetMembersList(h)},
 | 
						{title: "calls/members", handler: (h) => CallsController.GetMembersList(h)},
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	{title: "calls/signal", handler: (h) => CallsController.OnClientSignal(h)},
 | 
						{title: "calls/signal", handler: (h) => CallsController.OnClientSignal(h)},
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						{title: "calls/mark_ready", handler: (h) => CallsController.MarkUserReady(h)},
 | 
				
			||||||
]
 | 
					]
 | 
				
			||||||
		Reference in New Issue
	
	Block a user