Skip to content

Commit

Permalink
Add config to send session membership state events (#2460)
Browse files Browse the repository at this point in the history
If not set, legacy call membership state events are sent instead.
Even if set, legacy events are sent in rooms with active legacy calls.

---------

Co-authored-by: Timo <16718859+toger5@users.noreply.github.com>
  • Loading branch information
AndrewFerr and toger5 committed Jul 5, 2024
1 parent ca45067 commit 34c7d02
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
16 changes: 13 additions & 3 deletions src/config/ConfigOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,21 @@ export interface ConfigOptions {
};

/**
* Allow to join a group calls without audio and video.
* TEMPORARY: Is a feature that's not proved and experimental
* TEMPORARY experimental features.
*/
features?: {
feature_group_calls_without_video_and_audio: boolean;
/**
* Allow to join group calls without audio and video.
*/
feature_group_calls_without_video_and_audio?: boolean;
/**
* Send device-specific call session membership state events instead of
* legacy user-specific call membership state events.
* This setting has no effect when the user joins an active call with
* legacy state events. For compatibility, Element Call will always join
* active legacy calls with legacy state events.
*/
feature_use_device_session_member_events?: boolean;
};

/**
Expand Down
9 changes: 8 additions & 1 deletion src/rtcSessionHelpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,17 @@ export async function enterRTCSession(

// right now we assume everything is a room-scoped call
const livekitAlias = rtcSession.room.roomId;
const useDeviceSessionMemberEvents =
Config.get().features?.feature_use_device_session_member_events;
rtcSession.joinRoomSession(
await makePreferredLivekitFoci(rtcSession, livekitAlias),
makeActiveFocus(),
{ manageMediaKeys: encryptMedia },
{
manageMediaKeys: encryptMedia,
...(useDeviceSessionMemberEvents !== undefined && {
useLegacyMemberEvents: !useDeviceSessionMemberEvents,
}),
},
);
}

Expand Down

0 comments on commit 34c7d02

Please sign in to comment.