Interface IMembershipManagerInternal

This interface defines what a MembershipManager uses and exposes. This interface is what we use to write tests and allows changing the actual implementation without breaking tests because of some internal method renaming.

interface IMembershipManager {
    getActiveFocus(): undefined | Focus;
    isJoined(): boolean;
    join(
        fociPreferred: Focus[],
        fociActive?: Focus,
        onError?: (error: unknown) => void,
    ): void;
    leave(timeout?: number): Promise<boolean>;
    onRTCSessionMemberUpdate(memberships: CallMembership[]): Promise<void>;
}

Methods

  • If we are trying to join, or have successfully joined the session. It does not reflect if the room state is already configured to represent us being joined. It only means that the Manager should be trying to connect or to disconnect running. The Manager is still running right after isJoined becomes false to send the disconnect events. (A more accurate name would be isActivated)

    Returns boolean

    true if we intend to be participating in the MatrixRTC session

  • Start sending all necessary events to make this user participate in the RTC session.

    Parameters

    • fociPreferred: Focus[]

      the list of preferred foci to use in the joined RTC membership event.

    • OptionalfociActive: Focus

      the active focus to use in the joined RTC membership event.

    • OptionalonError: (error: unknown) => void

    Returns void

    can throw if it exceeds a configured maximum retry.

  • Send all necessary events to make this user leave the RTC session.

    Parameters

    • Optionaltimeout: number

      the maximum duration in ms until the promise is forced to resolve.

    Returns Promise<boolean>

    It resolves with true in case the leave was sent successfully. It resolves with false in case we hit the timeout before sending successfully.

MMNEPVFCICPMFPCPTTAAATR