ваше сообщение коммита

This commit is contained in:
2025-06-19 20:19:09 +03:00
parent 90a088e021
commit f728c5f5da
24 changed files with 512 additions and 183 deletions

View File

@@ -19,4 +19,12 @@ function broadcastContactsUpdate() {
}
}
module.exports = { initWSS, broadcastContactsUpdate };
function broadcastMessagesUpdate() {
for (const ws of wsClients) {
if (ws.readyState === WebSocket.OPEN) {
ws.send(JSON.stringify({ type: 'messages-updated' }));
}
}
}
module.exports = { initWSS, broadcastContactsUpdate, broadcastMessagesUpdate };