Add config to send session membership state events (#2460)

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>
This commit is contained in:
Andrew Ferrazzutti 2024-07-05 21:10:16 +09:00 committed by GitHub
parent ca45067158
commit 34c7d02de2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 21 additions and 4 deletions

View File

@ -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;
};
/**

View File

@ -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,
}),
},
);
}