|
@@ -37,20 +37,24 @@ export class SyncDeviceController extends BasicController {
|
|
|
this.socket.on(EVENT.clientSyncAction, (data) => {
|
|
|
this.socket.broadcast.to(this.room.syncId).emit(EVENT.clientSyncAction, data);
|
|
|
});
|
|
|
- this.socket.on(EVENT.changeVoiceStatus, async ({ status, user }) => {
|
|
|
+ this.socket.on(EVENT.changeVoiceStatus, async ({ status }) => {
|
|
|
try {
|
|
|
+ const current = await this.room.currentUser();
|
|
|
const updateUser = {
|
|
|
- ...user,
|
|
|
+ ...current,
|
|
|
+ onlineStatus: 1,
|
|
|
voiceStatus: status,
|
|
|
};
|
|
|
+
|
|
|
+
|
|
|
const isUpdate = await updateRoomUser(this.room.roomId, this.room.userId, updateUser);
|
|
|
const AllRoomUsers = await getAllRoomUsers(this.room.roomId);
|
|
|
- // this.logger.info("changeVoiceStatus", { roomId: this.room.roomId, data, AllRoomUsers: AllRoomUsers.length });
|
|
|
+ this.logger.info("changeVoiceStatus", { roomId: this.room.roomId, updateUser, AllRoomUsers: AllRoomUsers.length });
|
|
|
this.socket.broadcast.to(this.room.roomId).emit(EVENT.changeVoiceStatus, {
|
|
|
user: updateUser,
|
|
|
roomsPerson: AllRoomUsers,
|
|
|
});
|
|
|
- this.socket.broadcast.to(this.room.syncId).emit(EVENT.changeVoiceStatus, {
|
|
|
+ this.socket.broadcast.to(this.room.syncId).emit(EVENT.changeVoiceStatus, {
|
|
|
user: updateUser,
|
|
|
roomsPerson: AllRoomUsers,
|
|
|
});
|