@leofcoin/peernet 0.14.23 → 0.14.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -509,11 +509,12 @@ class Peer {
509
509
 
510
510
  async _in(message, data) {
511
511
  // message = JSON.parse(message);
512
- if (message.to !== this.id) return
512
+ if (!this.#connection || message.to !== this.id || message.from !== this.#peerId) return
513
513
  // if (data.videocall) return this._startStream(true, false); // start video and audio stream
514
514
  // if (data.call) return this._startStream(true, true); // start audio stream
515
- if (!this.#connection || this.#connection?.signalinState === 'stable' && this.#connection?.remoteDescription !== null && this.#connection?.localDescription !== null) return
515
+ if (this.#connection?.signalinState === 'stable' && this.#connection?.remoteDescription !== null && this.#connection?.localDescription !== null) return
516
516
 
517
+
517
518
  if (message.candidate) {
518
519
  debug(`incoming candidate ${this.#channelName}`)
519
520
  // debug(message.candidate.candidate)
@@ -508,11 +508,12 @@ class Peer {
508
508
 
509
509
  async _in(message, data) {
510
510
  // message = JSON.parse(message);
511
- if (message.to !== this.id) return
511
+ if (!this.#connection || message.to !== this.id || message.from !== this.#peerId) return
512
512
  // if (data.videocall) return this._startStream(true, false); // start video and audio stream
513
513
  // if (data.call) return this._startStream(true, true); // start audio stream
514
- if (!this.#connection || this.#connection?.signalinState === 'stable' && this.#connection?.remoteDescription !== null && this.#connection?.localDescription !== null) return
514
+ if (this.#connection?.signalinState === 'stable' && this.#connection?.remoteDescription !== null && this.#connection?.localDescription !== null) return
515
515
 
516
+
516
517
  if (message.candidate) {
517
518
  debug(`incoming candidate ${this.#channelName}`)
518
519
  // debug(message.candidate.candidate)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leofcoin/peernet",
3
- "version": "0.14.23",
3
+ "version": "0.14.24",
4
4
  "description": "",
5
5
  "source": "src/peernet.js",
6
6
  "main": "dist/commonjs/peernet.js",