@freesignal/protocol 0.8.2 → 0.8.3

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.
Files changed (2) hide show
  1. package/dist/node.js +3 -3
  2. package/package.json +1 -1
package/dist/node.js CHANGED
@@ -253,12 +253,12 @@ export class FreeSignalNode {
253
253
  const encrypted = EncryptedDatagram.from(datagram);
254
254
  if (!encrypted.payload)
255
255
  throw new Error("Missing payload");
256
- if ((yield this.openHandshake(datagram)) === 'ack')
257
- return;
256
+ const handshakeState = yield this.openHandshake(datagram);
258
257
  const session = yield this.sessions.get(encrypted.sessionTag);
259
258
  if (!session)
260
259
  throw new Error("Session not found for sessionTag: " + encrypted.sessionTag);
261
- yield this.sendHandshake(session);
260
+ if (handshakeState === 'syn')
261
+ yield this.sendHandshake(session);
262
262
  this.emitter.emit('handshake', { session });
263
263
  return;
264
264
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@freesignal/protocol",
3
- "version": "0.8.2",
3
+ "version": "0.8.3",
4
4
  "description": "Signal Protocol implementation in javascript",
5
5
  "license": "GPL-3.0-or-later",
6
6
  "author": "Christian Braghette",