diff --git a/src/config/ConfigOptions.ts b/src/config/ConfigOptions.ts index 29c5230ef..00e0bfa2d 100644 --- a/src/config/ConfigOptions.ts +++ b/src/config/ConfigOptions.ts @@ -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; }; /** diff --git a/src/rtcSessionHelpers.ts b/src/rtcSessionHelpers.ts index 0b1730f6b..451871eae 100644 --- a/src/rtcSessionHelpers.ts +++ b/src/rtcSessionHelpers.ts @@ -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, + }), + }, ); }