@stream-io/video-client 0.0.51 → 0.1.1

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/dist/index.cjs.js CHANGED
@@ -8401,7 +8401,7 @@ const watchCallSessionParticipantJoined = (state) => {
8401
8401
  return function onCallParticipantJoined(event) {
8402
8402
  if (event.type !== 'call.session_participant_joined')
8403
8403
  return;
8404
- const { user, user_session_id } = event;
8404
+ const { participant } = event;
8405
8405
  state.setMetadata((metadata) => {
8406
8406
  if (!metadata || !metadata.session) {
8407
8407
  state.logger('warn', `Received call.session_participant_joined event but the metadata structure is invalid.`, event);
@@ -8409,16 +8409,8 @@ const watchCallSessionParticipantJoined = (state) => {
8409
8409
  }
8410
8410
  const { session } = metadata;
8411
8411
  const { participants, participants_count_by_role } = session;
8412
- return Object.assign(Object.assign({}, metadata), { session: Object.assign(Object.assign({}, session), { participants: [
8413
- ...participants,
8414
- {
8415
- // FIXME OL: ideally, this comes from the backend
8416
- joined_at: new Date().toISOString(),
8417
- user,
8418
- role: user.role,
8419
- user_session_id,
8420
- },
8421
- ], participants_count_by_role: Object.assign(Object.assign({}, participants_count_by_role), { [user.role]: (participants_count_by_role[user.role] || 0) + 1 }) }) });
8412
+ const { user } = participant;
8413
+ return Object.assign(Object.assign({}, metadata), { session: Object.assign(Object.assign({}, session), { participants: [...participants, participant], participants_count_by_role: Object.assign(Object.assign({}, participants_count_by_role), { [user.role]: (participants_count_by_role[user.role] || 0) + 1 }) }) });
8422
8414
  });
8423
8415
  };
8424
8416
  };
@@ -8431,7 +8423,7 @@ const watchCallSessionParticipantLeft = (state) => {
8431
8423
  return function onCallParticipantLeft(event) {
8432
8424
  if (event.type !== 'call.session_participant_left')
8433
8425
  return;
8434
- const { user, user_session_id } = event;
8426
+ const { user, user_session_id } = event.participant;
8435
8427
  state.setMetadata((metadata) => {
8436
8428
  if (!metadata || !metadata.session) {
8437
8429
  state.logger('warn', `Received call.session_participant_left event but the metadata structure is invalid.`, event);
@@ -11349,7 +11341,7 @@ class WSConnectionFallback {
11349
11341
  }
11350
11342
  }
11351
11343
 
11352
- const version = '0.0.51';
11344
+ const version = '0.1.1';
11353
11345
 
11354
11346
  const logger = getLogger(['location']);
11355
11347
  const HINT_URL = `https://hint.stream-io-video.com/`;