@@ -21,6 +21,7 @@ import { MeetingGrpcService } from 'src/infrastructure/services/meeting/meeting.
21
21
import RedisEvents from 'src/domain/constants/redis_events' ;
22
22
import { MessageBroker } from 'src/infrastructure/services/message-broker/message-broker' ;
23
23
import { EnvironmentConfigService } from 'src/infrastructure/config/environment/environments' ;
24
+ import { SetSubscribeSubtitleDto } from './dtos/set_subscribe_subtitle.dto' ;
24
25
25
26
@WebSocketGateway ( )
26
27
export class MeetingGateway {
@@ -36,7 +37,7 @@ export class MeetingGateway {
36
37
}
37
38
38
39
@WebSocketServer ( ) private server : Server ;
39
- private logger : Logger = new Logger ( ' MeetingGateway' ) ;
40
+ private logger : Logger = new Logger ( MeetingGateway . name ) ;
40
41
41
42
@SubscribeMessage ( SocketEvent . publishCSS )
42
43
async handleJoinRoom ( client : ISocketClient , payload : JoinRoomDto ) {
@@ -102,18 +103,12 @@ export class MeetingGateway {
102
103
...responsePayload ,
103
104
} ) ;
104
105
} else {
105
- const clientInfo = this . rtcManager . getClientBySocketId ( {
106
- clientId : client . id ,
107
- } ) ;
108
-
109
- if ( ! clientInfo ) return ;
110
-
111
106
this . messageBroker . publishRedisChannel (
112
107
participantInfo . ccu . podName ,
113
108
RedisEvents . SUBSCRIBE ,
114
109
{
115
- participantId : clientInfo . participantId ,
116
- roomId : clientInfo . roomId ,
110
+ participantId : payload . participantId ,
111
+ roomId : payload . roomId ,
117
112
targetId : payload . targetId ,
118
113
clientId : client . id ,
119
114
} ,
@@ -321,6 +316,48 @@ export class MeetingGateway {
321
316
} ) ;
322
317
}
323
318
319
+ @SubscribeMessage ( SocketEvent . handRaisingCSS )
320
+ handleSetHandRaising ( client : ISocketClient , payload : any ) : any {
321
+ const clientInfo = this . rtcManager . getClientBySocketId ( {
322
+ clientId : client . id ,
323
+ } ) ;
324
+
325
+ if ( ! clientInfo ) return ;
326
+
327
+ const roomId = clientInfo . roomId ;
328
+ const targetId = clientInfo . participantId ;
329
+
330
+ if ( ! roomId ) return ;
331
+
332
+ client . broadcast . to ( roomId ) . emit ( SocketEvent . handRaisingSSC , {
333
+ participantId : targetId ,
334
+ } ) ;
335
+ }
336
+
337
+ @SubscribeMessage ( SocketEvent . setSubscribeSubtitleCSS )
338
+ handleSetSubscribeSubtitle (
339
+ client : ISocketClient ,
340
+ payload : SetSubscribeSubtitleDto ,
341
+ ) : any {
342
+ const clientInfo = this . rtcManager . getClientBySocketId ( {
343
+ clientId : client . id ,
344
+ } ) ;
345
+
346
+ if ( ! clientInfo ) return ;
347
+
348
+ const roomId = clientInfo . roomId ;
349
+
350
+ if ( ! roomId ) return ;
351
+
352
+ const subtitleChannel = SocketEvent . subtitleSSC + roomId ;
353
+
354
+ if ( payload . enabled ) {
355
+ client . join ( subtitleChannel ) ;
356
+ } else {
357
+ client . leave ( subtitleChannel ) ;
358
+ }
359
+ }
360
+
324
361
@SubscribeMessage ( SocketEvent . leaveRoomCSS )
325
362
async handleLeaveRoom ( client : ISocketClient , payload : any ) {
326
363
const info = this . rtcManager . leaveRoom ( { clientId : client . id } ) ;
0 commit comments