Removing useless roomID parameter in WebRtcSignal message

This commit is contained in:
David Négrier 2020-08-20 15:21:07 +02:00
parent 0119534283
commit 894f7c8009
3 changed files with 6 additions and 10 deletions

View File

@ -9,7 +9,6 @@ export const isWebRtcSignalMessageInterface =
new tg.IsInterface().withProperties({
userId: tg.isString,
receiverId: tg.isString,
roomId: tg.isString,
signal: isSignalData
}).get();
export const isWebRtcScreenSharingStartMessageInterface =

View File

@ -82,7 +82,6 @@ export interface WebRtcDisconnectMessageInterface {
export interface WebRtcSignalMessageInterface {
userId: string, // TODO: is this needed?
receiverId: string,
roomId: string,
signal: SignalData
}
@ -188,22 +187,20 @@ export class Connection implements Connection {
this.socket.on(EventMessage.CONNECT_ERROR, callback)
}
public sendWebrtcSignal(signal: unknown, roomId: string, userId? : string|null, receiverId? : string) {
public sendWebrtcSignal(signal: unknown, userId? : string|null, receiverId? : string) {
return this.socket.emit(EventMessage.WEBRTC_SIGNAL, {
userId: userId ? userId : this.userId,
receiverId: receiverId ? receiverId : this.userId,
roomId: roomId,
signal: signal
});
} as WebRtcSignalMessageInterface);
}
public sendWebrtcScreenSharingSignal(signal: unknown, roomId: string, userId? : string|null, receiverId? : string) {
public sendWebrtcScreenSharingSignal(signal: unknown, userId? : string|null, receiverId? : string) {
return this.socket.emit(EventMessage.WEBRTC_SCREEN_SHARING_SIGNAL, {
userId: userId ? userId : this.userId,
receiverId: receiverId ? receiverId : this.userId,
roomId: roomId,
signal: signal
});
} as WebRtcSignalMessageInterface);
}
public receiveWebrtcStart(callback: (message: WebRtcStartMessageInterface) => void) {

View File

@ -311,7 +311,7 @@ export class SimplePeer {
*/
private sendWebrtcSignal(data: unknown, userId : string) {
try {
this.Connection.sendWebrtcSignal(data, this.WebRtcRoomId, null, userId);
this.Connection.sendWebrtcSignal(data, null, userId);
}catch (e) {
console.error(`sendWebrtcSignal => ${userId}`, e);
}
@ -325,7 +325,7 @@ export class SimplePeer {
private sendWebrtcScreenSharingSignal(data: unknown, userId : string) {
console.log("sendWebrtcScreenSharingSignal", data);
try {
this.Connection.sendWebrtcScreenSharingSignal(data, this.WebRtcRoomId, null, userId);
this.Connection.sendWebrtcScreenSharingSignal(data, null, userId);
}catch (e) {
console.error(`sendWebrtcScreenSharingSignal => ${userId}`, e);
}