Fixed app.js not sending user ID itself and only peers it knows #5

Merged
snxraven merged 26 commits from MiTask/LinkUp-P2P-Chat:main into main 2024-06-10 11:26:59 -04:00
Showing only changes of commit 051aa09c2d - Show all commits

2
app.js
View File

@ -297,7 +297,7 @@ function sendMessage(e) {
onMessageAdded(config.userName, message, config.userAvatar);
let peersPublicKeys = [];
peersPublicKeys.push([...swarm.connections].map(peer => peer.remotePublicKey.toString('hex')));
peersPublicKeys.push([...swarm.connections].map(peer => peer.remotePublicKey.toString('hex')).flat(1));
peersPublicKeys.push(swarm.keyPair.publicKey.toString('hex'));
const messageObj = JSON.stringify({