|
@@ -29,10 +29,11 @@ export class ActionsService {
|
|
|
'handleAllAction',
|
|
|
);
|
|
|
}
|
|
|
+
|
|
|
this.roomService.logger.warn(
|
|
|
- `当前--broadcast:${roomId},
|
|
|
- data:${JSON.stringify(data)}
|
|
|
- action:${data.type} ,isLeader:${isSocketLeader()}`,
|
|
|
+ `当前--broadcast:${roomId}, data:${JSON.stringify(data)}action:${
|
|
|
+ data.type
|
|
|
+ } ,isLeader:${isSocketLeader()}`,
|
|
|
'handleAllAction',
|
|
|
);
|
|
|
switch (data.type) {
|
|
@@ -46,11 +47,13 @@ export class ActionsService {
|
|
|
break;
|
|
|
case 'users-muted':
|
|
|
const mutedParams = data as any as MutedStateType;
|
|
|
+ mutedParams.roomId = roomId;
|
|
|
isSocketLeader() && (await this.handleMutedState(mutedParams));
|
|
|
await this.roomService.handleRoomStatusAction(socket);
|
|
|
break;
|
|
|
case 'users-words':
|
|
|
const typingParams = data as any as TypingStateType;
|
|
|
+ typingParams.roomId = roomId;
|
|
|
isSocketLeader() && (await this.handleTypingState(typingParams));
|
|
|
this.roomService.handleRoomStatusAction(socket);
|
|
|
await this.roomService.handleRoomStatusAction(socket);
|
|
@@ -86,7 +89,7 @@ export class ActionsService {
|
|
|
}
|
|
|
async handleMutedState(data: MutedStateType) {
|
|
|
if (data) {
|
|
|
- const roomId = this.roomService._userInfo.RoomId;
|
|
|
+ const roomId = data.roomId;
|
|
|
const userId = data.userId;
|
|
|
const mutedState = data.muted;
|
|
|
this.roomService.logger.warn(
|
|
@@ -98,7 +101,7 @@ export class ActionsService {
|
|
|
}
|
|
|
async handleTypingState(data: TypingStateType) {
|
|
|
if (data) {
|
|
|
- const roomId = this.roomService._userInfo.RoomId;
|
|
|
+ const roomId = data.roomId;
|
|
|
const userId = data.userId;
|
|
|
const wordsState = data.words;
|
|
|
await this.userService.updateUserTypingState(roomId, userId, wordsState);
|