Skip to content

Commit

Permalink
Should not notify peer the existence of itself.
Browse files Browse the repository at this point in the history
  • Loading branch information
mwy001 committed Nov 3, 2022
1 parent abc6682 commit f1a5b0d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ class SnapdropServer {

// notify all other peers
for (const otherPeerId in this._rooms[peer.ip]) {
if (otherPeerId == peer.id) continue;
const otherPeer = this._rooms[peer.ip][otherPeerId];
this._send(otherPeer, {
type: 'peer-joined',
Expand All @@ -98,6 +99,7 @@ class SnapdropServer {
// notify peer about the other peers
const otherPeers = [];
for (const otherPeerId in this._rooms[peer.ip]) {
if (otherPeerId == peer.id) continue;
otherPeers.push(this._rooms[peer.ip][otherPeerId].getInfo());
}

Expand Down

0 comments on commit f1a5b0d

Please sign in to comment.