ep_webrtc 2.0.2 → 2.0.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.
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "url": "git@github.com:ether/ep_webrtc.git",
6
6
  "type": "git"
7
7
  },
8
- "version": "2.0.2",
8
+ "version": "2.0.3",
9
9
  "description": "WebRTC based audio/video chat to Etherpad",
10
10
  "author": "John McLear <john@mclear.co.uk>",
11
11
  "contributors": [],
@@ -1239,6 +1239,9 @@ exports.rtc = new class {
1239
1239
  }
1240
1240
 
1241
1241
  sendMessage(to, data) {
1242
+ if (data.ids == null) data.ids = {};
1243
+ if (data.ids.from == null) data.ids.from = {};
1244
+ data.ids.from.session = sessionId;
1242
1245
  debug(`(${to == null ? 'to everyone on the pad' : `peer ${to}`}) sending message`, data);
1243
1246
  this._pad.collabClient.sendMessage({
1244
1247
  type: 'RTC_MESSAGE',
@@ -1276,7 +1279,7 @@ exports.rtc = new class {
1276
1279
  // the WebRTC signaling messages. This is bad because WebRTC assumes reliable, in-order delivery
1277
1280
  // of signaling messages, so the discards will break future connection attempts.
1278
1281
  invitePeer(userId) {
1279
- this.sendMessage(userId, {ids: {from: {session: sessionId}}, invite: 'invite'});
1282
+ this.sendMessage(userId, {invite: 'invite'});
1280
1283
  }
1281
1284
 
1282
1285
  getPeerConnection(userId) {