matrix-appservice-bridge
    Preparing search index...

    Class ActivityTracker

    This class provides a "one stop shop" to determine if a user is online. It uses a combination of a local cache, presence endpoints and admin APIs in that order.

    Index

    Constructors

    Accessors

    • get usingWhois(): null | boolean

      Returns null | boolean

    Methods

    • Determine if a user is online or offline using a range of metrics.

      Parameters

      • userId: string

        The userId to check

      • maxTimeMs: number

        The maximum time a user may be inactive for before they are considered offline.

      • OptionaldefaultOnline: boolean

        Should the user be online or offline if no data is found. Defaults to opts.defaultOnline

      Returns Promise<{ inactiveMs: number; online: boolean }>

    • Sets the last active time of the user to ts. By default this is the current time.

      Parameters

      • userId: string

        The userId of a user who performed an action.

      • ts: number = ...

        The timestamp to set in milliseconds.

      Returns void