Constructors

  • Construct a Matrix user.

    Parameters

    • userId: string

      The userId of the user.

    • _data: Record<string, unknown> = {}
    • escape: boolean = MatrixUser.ESCAPE_DEFAULT

      Escape the user's localpart. Modify ~ESCAPE_DEFAULT to change the default value.

    Returns MatrixUser

Properties

host: string
userId: string

The userId of the user.

ESCAPE_DEFAULT: boolean = true

Static

This is a global variable to modify the default escaping behaviour of MatrixUser.

Accessors

Methods

  • Get the data value for the given key.

    Type Parameters

    • T

    Parameters

    • key: string

      An arbitrary bridge-specific key.

    Returns T

    Stored data for this key. May be undefined.

  • Get the display name for this Matrix user.

    Returns null | string

    The display name.

  • Serialize all the data about this user, excluding the user ID.

    Returns {
        localpart: string;
    }

    The serialised data

    • localpart: string
  • Set an arbitrary bridge-specific data value for this room.

    Parameters

    • key: string

      The key to store the data value under.

    • val: unknown

      The data value. This value should be serializable via JSON.stringify(data).

    Returns void

  • Set the display name for this Matrix user.

    Parameters

    • name: string

      The Matrix display name.

    Returns void

Generated using TypeDoc