forked from snxraven/LinkUp-P2P-Chat
I might've fix sending all 'peers' lol
This commit is contained in:
parent
704f6ca0dc
commit
961599f366
4
app.js
4
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
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user