Fixed app.js not sending user ID itself and only peers it knows #5
2
app.js
2
app.js
@ -297,7 +297,7 @@ function sendMessage(e) {
|
|||||||
onMessageAdded(config.userName, message, config.userAvatar);
|
onMessageAdded(config.userName, message, config.userAvatar);
|
||||||
|
|
||||||
let peersPublicKeys = [];
|
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'));
|
peersPublicKeys.push(swarm.keyPair.publicKey.toString('hex'));
|
||||||
|
|
||||||
const messageObj = JSON.stringify({
|
const messageObj = JSON.stringify({
|
||||||
|
Loading…
Reference in New Issue
Block a user