fix: should now sync with other devices
All checks were successful
Queue Release Build / prepare (push) Successful in 25s
Deploy Web Apps / deploy (push) Successful in 7m8s
Queue Release Build / build-windows (push) Successful in 28m10s
Queue Release Build / build-linux (push) Successful in 44m38s
Queue Release Build / build-android (push) Successful in 18m36s
Queue Release Build / finalize (push) Successful in 1m40s
All checks were successful
Queue Release Build / prepare (push) Successful in 25s
Deploy Web Apps / deploy (push) Successful in 7m8s
Queue Release Build / build-windows (push) Successful in 28m10s
Queue Release Build / build-linux (push) Successful in 44m38s
Queue Release Build / build-android (push) Successful in 18m36s
Queue Release Build / finalize (push) Successful in 1m40s
This commit is contained in:
@@ -296,6 +296,11 @@ async function handleIdentify(user: ConnectedUser, message: WsMessage, connectio
|
||||
connectedUsers.set(connectionId, user);
|
||||
console.log(`User identified: ${user.displayName} (${user.oderId})`);
|
||||
|
||||
notifyOtherConnectionsForOderId(newOderId, {
|
||||
type: 'account_sync_peer_online',
|
||||
clientInstanceId: newClientInstanceId
|
||||
}, connectionId);
|
||||
|
||||
const voiceSnapshot = Array.from(connectedUsers.entries()).find(([otherConnectionId, otherUser]) =>
|
||||
otherConnectionId !== connectionId
|
||||
&& otherUser.oderId === newOderId
|
||||
@@ -541,6 +546,21 @@ function handleVoiceClientTakeover(user: ConnectedUser, message: WsMessage, conn
|
||||
}, connectionId);
|
||||
}
|
||||
|
||||
function handleAccountSync(user: ConnectedUser, message: WsMessage, connectionId: string): void {
|
||||
const payload = message['payload'];
|
||||
|
||||
if (!payload || typeof payload !== 'object' || typeof (payload as { type?: unknown }).type !== 'string') {
|
||||
return;
|
||||
}
|
||||
|
||||
notifyOtherConnectionsForOderId(user.oderId, {
|
||||
type: 'account_sync',
|
||||
clientInstanceId: normalizeClientInstanceId(message['clientInstanceId']) ?? user.clientInstanceId,
|
||||
fromUserId: user.oderId,
|
||||
payload
|
||||
}, connectionId);
|
||||
}
|
||||
|
||||
function handleTyping(user: ConnectedUser, message: WsMessage, connectionId: string): void {
|
||||
const typingSid = (message['serverId'] as string | undefined) ?? user.viewedServerId;
|
||||
const channelId = typeof message['channelId'] === 'string' && message['channelId'].trim() ? message['channelId'].trim() : 'general';
|
||||
@@ -747,6 +767,10 @@ export async function handleWebSocketMessage(connectionId: string, message: WsMe
|
||||
handleVoiceClientTakeover(user, message, connectionId);
|
||||
break;
|
||||
|
||||
case 'account_sync':
|
||||
handleAccountSync(user, message, connectionId);
|
||||
break;
|
||||
|
||||
case 'typing':
|
||||
handleTyping(user, message, connectionId);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user