matrix-appservice-bridge
    Preparing search index...

    Class MembershipQueue

    This class sends membership changes for rooms in a linearized queue. The queue is lineaized based upon the hash value of the roomId, so that two operations for the same roomId may never happen concurrently.

    Index

    Constructors

    Methods

    • Join a user to a room

      Parameters

      • roomId: string

        The roomId to join

      • userId: undefined | string

        Leave empty to act as the bot user.

      • req: ThinRequest

        The request entry for logging context

      • retry: boolean = true

        Should the request retry if it fails

      • Optionalttl: number

        How long should this request remain queued in milliseconds before it's discarded. Defaults to opts.defaultTtlMs

      Returns Promise<void>

      A promise that resolves when the membership has completed

    • Leave OR kick a user from a room

      Parameters

      • roomId: string

        The roomId to leave

      • userId: string

        Leave empty to act as the bot user.

      • req: ThinRequest

        The request entry for logging context

      • retry: boolean = true

        Should the request retry if it fails

      • Optionalreason: string

        Reason for leaving/kicking

      • OptionalkickUser: string

        The user to be kicked. If left blank, this will be a leave.

      • Optionalttl: number

        How long should this request remain queued in milliseconds before it's discarded. Defaults to opts.defaultTtlMs

      Returns Promise<void>

      A promise that resolves when the membership has completed

    • Parameters

      • item: QueueUserItem

      Returns Promise<void>

    • This should be called after starting the bridge in order to track metrics for the membership queue.

      Returns void