cringe sfx
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
import type { ChadClient, SomeSocket } from '../types/socket.ts'
|
||||
|
||||
export function socketToClient(socket: SomeSocket): ChadClient {
|
||||
// Socket.IO rooms: Extract channel room (filter out the socket's own room)
|
||||
const channelId = Array.from(socket.rooms).find(room => room !== socket.id) || 'default'
|
||||
|
||||
return {
|
||||
socketId: socket.id,
|
||||
userId: socket.data.userId,
|
||||
@@ -8,5 +11,6 @@ export function socketToClient(socket: SomeSocket): ChadClient {
|
||||
displayName: socket.data.displayName,
|
||||
inputMuted: socket.data.inputMuted,
|
||||
outputMuted: socket.data.outputMuted,
|
||||
currentChannelId: channelId,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user