matrix-js-sdk

    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 {
        get status(): Status;
        getActiveFocus(): undefined | Focus;
        isActivated(): boolean;
        isJoined(): boolean;
        join(
            fociPreferred: Focus[],
            fociActive?: Focus,
            onError?: (error: unknown) => void,
        ): void;
        leave(timeout?: number): Promise<boolean>;
        off(
            event: StatusChanged,
            listener: (oldStatus: Status, newStatus: Status) => void,
        ): this;
        on(
            event: StatusChanged,
            listener: (oldStatus: Status, newStatus: Status) => void,
        ): this;
        onRTCSessionMemberUpdate(memberships: CallMembership[]): Promise<void>;
    }
    Index

    Accessors

    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 the manager is activated. This means it tries to do its job to join the call, resend state events... It does not imply that the room state is already configured to represent being joined. It means that the Manager tries to connect or is connected. ("the manager is still active") Once leave() is called the manager is not activated anymore but still running until leave() resolves.

      Returns boolean

      true if we intend to be participating in the MatrixRTC session

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

      Returns boolean

      true if we intend to be participating in the MatrixRTC session

      This name is confusing and replaced by isActivated(). (Returns the same as isActivated())

    • 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