Interface IMembershipManagerInternal

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

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

Methods

  • The used active focus in the currently joined session.

    Returns undefined | Focus

    the used active focus in the currently joined session or undefined if not joined.

  • 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.

    Returns boolean

    true if we intend to be participating in the MatrixRTC session

  • Start sending all necessary events to make this user participant 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.

    Returns void

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

    Parameters

    • timeout: undefined | 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.