mirror of
https://github.com/schlagmichdoch/PairDrop.git
synced 2026-04-18 07:12:15 +00:00
- Enable renaming of own display name permanently via UI
- Make peerId completely ephemeral - Stabilize RTCConnection by closing connections cleanly
This commit is contained in:
11
index.js
11
index.js
@@ -453,7 +453,7 @@ class Peer {
|
||||
this._setIP(request);
|
||||
|
||||
// set peer id
|
||||
this._setPeerId(request)
|
||||
this.id = crypto.randomUUID();
|
||||
|
||||
// is WebRTC supported ?
|
||||
this.rtcSupported = request.url.indexOf('webrtc') > -1;
|
||||
@@ -525,15 +525,6 @@ class Peer {
|
||||
return false;
|
||||
}
|
||||
|
||||
_setPeerId(request) {
|
||||
let peer_id = new URL(request.url, "http://server").searchParams.get("peer_id");
|
||||
if (peer_id && Peer.isValidUuid(peer_id)) {
|
||||
this.id = peer_id;
|
||||
} else {
|
||||
this.id = crypto.randomUUID();
|
||||
}
|
||||
}
|
||||
|
||||
toString() {
|
||||
return `<Peer id=${this.id} ip=${this.ip} rtcSupported=${this.rtcSupported}>`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user