From 7ed15be77019695e2ccfc236d8fd3160848d1d8a Mon Sep 17 00:00:00 2001 From: raven Date: Thu, 12 Jan 2023 20:24:24 -0500 Subject: [PATCH] rand --- node | 0 sshChat.js | 6 +++--- 2 files changed, 3 insertions(+), 3 deletions(-) create mode 100644 node diff --git a/node b/node new file mode 100644 index 0000000..e69de29 diff --git a/sshChat.js b/sshChat.js index c836768..e80fb88 100644 --- a/sshChat.js +++ b/sshChat.js @@ -35,13 +35,13 @@ function sleep(ms) { function addUser(user, peerId) { connectedUsers.push({ name: user, peerId: peerId }); - sidebarBox.setContent(connectedUsers.map(user => `${user.name} - ${user.peerId}`).join("\n")); + sidebarBox.setContent(connectedUsers.map(user => `${user.peerId}`).join("\n")); screen.render(); } function removeUser(peerId) { connectedUsers = connectedUsers.filter(user => user.peerId !== peerId); - sidebarBox.setContent("Connected Peers: \n" + connectedUsers.map(user => `${user.name} - ${user.peerId}`).join("\n")); + sidebarBox.setContent("Peers since connection: \n" + connectedUsers.map(user => `${user.peerId}`).join("\n")); screen.render(); } @@ -218,7 +218,7 @@ swarm.on('connection', conn => { const name = b4a.toString(conn.remotePublicKey, 'hex') console.log(`* got a connection from ${name} (${USERNAME[0]}) *`) addUser(USERNAME[0], name) - sidebarBox.setLabel("Connected Peers: " + connectedUsers.length) + sidebarBox.setLabel("Peers since connection: " + connectedUsers.length) screen.render() conns.push(conn) conn.once('close', () => conns.splice(conns.indexOf(conn), 1))