From 961599f366491d5962b6411d5eb8b90cf5cd2fba Mon Sep 17 00:00:00 2001 From: MrMasrozYTLIVE <61359286+MrMasrozYTLIVE@users.noreply.github.com> Date: Mon, 10 Jun 2024 17:19:36 +0300 Subject: [PATCH] I might've fix sending all 'peers' lol --- app.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app.js b/app.js index 5e95740..9ab3779 100644 --- a/app.js +++ b/app.js @@ -296,15 +296,13 @@ function sendMessage(e) { onMessageAdded(config.userName, message, config.userAvatar); - console.log(swarm.keyPair); - console.log("swarm:", swarm); const messageObj = JSON.stringify({ type: 'message', name: config.userName, message, avatar: config.userAvatar, topic: b4a.toString(currentRoom.topic, 'hex'), - peers: [...swarm.connections].map(peer => peer.remotePublicKey.toString('hex')), + peers: [...swarm.connections].map(peer => peer.remotePublicKey.toString('hex')).push(swarm.keyPair.publicKey.toString('hex')), timestamp: Date.now(), readableTimestamp: new Date().toLocaleString(), // Added human-readable timestamp });