From 826ce780e657879fdae6d3e012afda50c7d9ed5b Mon Sep 17 00:00:00 2001 From: Timo Date: Mon, 13 Jan 2025 18:41:59 +0100 Subject: [PATCH 1/3] docstrings for IMembershipManager interface --- src/matrixrtc/MembershipManager.ts | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/src/matrixrtc/MembershipManager.ts b/src/matrixrtc/MembershipManager.ts index e195917156..9cf5f2c349 100644 --- a/src/matrixrtc/MembershipManager.ts +++ b/src/matrixrtc/MembershipManager.ts @@ -18,13 +18,30 @@ import { MembershipConfig } from "./MatrixRTCSession.ts"; * @internal */ export interface IMembershipManager { + /** + * Returns true if we intend to be participating in the MatrixRTC session. + * This is determined by checking if the relativeExpiry has been set. + */ isJoined(): boolean; + /** + * Start sending all necessary events to make this user participant in the RTC session. + * @param fociPreferred the list of preferred foci to use in the joined RTC membership event. + * @param fociActive the active focus to use in the joined RTC membership event. + */ join(fociPreferred: Focus[], fociActive?: Focus): void; + /** + * Send all necessary events to make this user leave the RTC session + * @param timeout + */ leave(timeout: number | undefined): Promise; /** * call this if the MatrixRTC session members have changed */ onRTCSessionMemberUpdate(memberships: CallMembership[]): Promise; + /** + * Returns the used active focus in the currently joined session. + * @returns undefined if not joined. + */ getActiveFocus(): Focus | undefined; } @@ -102,10 +119,6 @@ export class LegacyMembershipManager implements IMembershipManager { private getOldestMembership: () => CallMembership | undefined, ) {} - /* - * Returns true if we intend to be participating in the MatrixRTC session. - * This is determined by checking if the relativeExpiry has been set. - */ public isJoined(): boolean { return this.relativeExpiry !== undefined; } From 08b98494aa04c723d15975bdfc0b8d9031c8c0be Mon Sep 17 00:00:00 2001 From: Timo Date: Mon, 13 Jan 2025 18:47:43 +0100 Subject: [PATCH 2/3] more details and cleanup --- src/matrixrtc/MembershipManager.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/matrixrtc/MembershipManager.ts b/src/matrixrtc/MembershipManager.ts index 9cf5f2c349..818f432e6e 100644 --- a/src/matrixrtc/MembershipManager.ts +++ b/src/matrixrtc/MembershipManager.ts @@ -19,8 +19,11 @@ import { MembershipConfig } from "./MatrixRTCSession.ts"; */ export interface IMembershipManager { /** - * Returns true if we intend to be participating in the MatrixRTC session. + * If we are trying to join the session. + * It does not reflect if the room state is already configures to represent us being joined. + * It only means that the Manager is running. * This is determined by checking if the relativeExpiry has been set. + * @returns true if we intend to be participating in the MatrixRTC session */ isJoined(): boolean; /** @@ -30,16 +33,16 @@ export interface IMembershipManager { */ join(fociPreferred: Focus[], fociActive?: Focus): void; /** - * Send all necessary events to make this user leave the RTC session + * Send all necessary events to make this user leave the RTC session. * @param timeout */ leave(timeout: number | undefined): Promise; /** - * call this if the MatrixRTC session members have changed + * Call this if the MatrixRTC session members have changed. */ onRTCSessionMemberUpdate(memberships: CallMembership[]): Promise; /** - * Returns the used active focus in the currently joined session. + * The used active focus in the currently joined session. * @returns undefined if not joined. */ getActiveFocus(): Focus | undefined; From 0d9208a20f35a7fe8305a3074f79493ee0995950 Mon Sep 17 00:00:00 2001 From: Timo Date: Mon, 13 Jan 2025 18:55:50 +0100 Subject: [PATCH 3/3] timeout docs --- src/matrixrtc/MembershipManager.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/matrixrtc/MembershipManager.ts b/src/matrixrtc/MembershipManager.ts index 818f432e6e..47b892d0d6 100644 --- a/src/matrixrtc/MembershipManager.ts +++ b/src/matrixrtc/MembershipManager.ts @@ -22,7 +22,6 @@ export interface IMembershipManager { * If we are trying to join the session. * It does not reflect if the room state is already configures to represent us being joined. * It only means that the Manager is running. - * This is determined by checking if the relativeExpiry has been set. * @returns true if we intend to be participating in the MatrixRTC session */ isJoined(): boolean; @@ -34,7 +33,9 @@ export interface IMembershipManager { join(fociPreferred: Focus[], fociActive?: Focus): void; /** * Send all necessary events to make this user leave the RTC session. - * @param timeout + * @param timeout the maximum duration in ms until the promise is forced to resolve. + * @returns It resolves with true in case the leave was sent successfully. + * It resolves with false in case we hit the timeout before sending successfully. */ leave(timeout: number | undefined): Promise; /** @@ -43,7 +44,7 @@ export interface IMembershipManager { onRTCSessionMemberUpdate(memberships: CallMembership[]): Promise; /** * The used active focus in the currently joined session. - * @returns undefined if not joined. + * @returns the used active focus in the currently joined session or undefined if not joined. */ getActiveFocus(): Focus | undefined; }