From c9e3b46b8116bbcb00b0304dbb0636bfed1126fc Mon Sep 17 00:00:00 2001 From: Andrew Ferrazzutti Date: Fri, 28 Jun 2024 13:43:39 -0400 Subject: [PATCH 1/3] Add config to send session membership state events If not set, legacy call membership state events are sent instead. Even if set, legacy events are sent in rooms with active legacy calls. --- src/config/ConfigOptions.ts | 14 +++++++++++--- src/rtcSessionHelpers.ts | 9 ++++++++- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/src/config/ConfigOptions.ts b/src/config/ConfigOptions.ts index 29c5230ef..f6d9e3ff2 100644 --- a/src/config/ConfigOptions.ts +++ b/src/config/ConfigOptions.ts @@ -65,11 +65,19 @@ 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 the legacy user-specific call membership state events, + * but not in rooms that contain active 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, + }), + }, ); } From 21a7297832dbf33125a04db6d927639611df91d1 Mon Sep 17 00:00:00 2001 From: Andrew Ferrazzutti Date: Tue, 2 Jul 2024 21:47:20 +0900 Subject: [PATCH 2/3] Update src/config/ConfigOptions.ts Co-authored-by: Timo <16718859+toger5@users.noreply.github.com> --- src/config/ConfigOptions.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/config/ConfigOptions.ts b/src/config/ConfigOptions.ts index f6d9e3ff2..ae07c4a70 100644 --- a/src/config/ConfigOptions.ts +++ b/src/config/ConfigOptions.ts @@ -74,8 +74,9 @@ export interface ConfigOptions { feature_group_calls_without_video_and_audio?: boolean; /** * Send device-specific call session membership state events - * instead of the legacy user-specific call membership state events, - * but not in rooms that contain active calls with legacy state events. + * instead of the legacy user-specific call membership state events. + * This setting has not effect when the user joins an active call with legacy state events. + * For compatibility Element Call will always join running legacy calls with legacy state events.``` */ feature_use_device_session_member_events?: boolean; }; From c2a9ed12a41c416dec5da00792ef88321879c0bd Mon Sep 17 00:00:00 2001 From: Andrew Ferrazzutti Date: Tue, 2 Jul 2024 08:50:37 -0400 Subject: [PATCH 3/3] Formatting --- src/config/ConfigOptions.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/config/ConfigOptions.ts b/src/config/ConfigOptions.ts index ae07c4a70..00e0bfa2d 100644 --- a/src/config/ConfigOptions.ts +++ b/src/config/ConfigOptions.ts @@ -73,10 +73,11 @@ export interface ConfigOptions { */ feature_group_calls_without_video_and_audio?: boolean; /** - * Send device-specific call session membership state events - * instead of the legacy user-specific call membership state events. - * This setting has not effect when the user joins an active call with legacy state events. - * For compatibility Element Call will always join running legacy calls with legacy state events.``` + * 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; };