@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.es.js CHANGED
@@ -8381,7 +8381,7 @@ const watchCallSessionParticipantJoined = (state) => {
8381
8381
  return function onCallParticipantJoined(event) {
8382
8382
  if (event.type !== 'call.session_participant_joined')
8383
8383
  return;
8384
- const { user, user_session_id } = event;
8384
+ const { participant } = event;
8385
8385
  state.setMetadata((metadata) => {
8386
8386
  if (!metadata || !metadata.session) {
8387
8387
  state.logger('warn', `Received call.session_participant_joined event but the metadata structure is invalid.`, event);
@@ -8389,16 +8389,8 @@ const watchCallSessionParticipantJoined = (state) => {
8389
8389
  }
8390
8390
  const { session } = metadata;
8391
8391
  const { participants, participants_count_by_role } = session;
8392
- return Object.assign(Object.assign({}, metadata), { session: Object.assign(Object.assign({}, session), { participants: [
8393
- ...participants,
8394
- {
8395
- // FIXME OL: ideally, this comes from the backend
8396
- joined_at: new Date().toISOString(),
8397
- user,
8398
- role: user.role,
8399
- user_session_id,
8400
- },
8401
- ], participants_count_by_role: Object.assign(Object.assign({}, participants_count_by_role), { [user.role]: (participants_count_by_role[user.role] || 0) + 1 }) }) });
8392
+ const { user } = participant;
8393
+ 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 }) }) });
8402
8394
  });
8403
8395
  };
8404
8396
  };
@@ -8411,7 +8403,7 @@ const watchCallSessionParticipantLeft = (state) => {
8411
8403
  return function onCallParticipantLeft(event) {
8412
8404
  if (event.type !== 'call.session_participant_left')
8413
8405
  return;
8414
- const { user, user_session_id } = event;
8406
+ const { user, user_session_id } = event.participant;
8415
8407
  state.setMetadata((metadata) => {
8416
8408
  if (!metadata || !metadata.session) {
8417
8409
  state.logger('warn', `Received call.session_participant_left event but the metadata structure is invalid.`, event);
@@ -11329,7 +11321,7 @@ class WSConnectionFallback {
11329
11321
  }
11330
11322
  }
11331
11323
 
11332
- const version = '0.0.51';
11324
+ const version = '0.1.1';
11333
11325
 
11334
11326
  const logger = getLogger(['location']);
11335
11327
  const HINT_URL = `https://hint.stream-io-video.com/`;