Hierarchy

  • MatrixUser

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 MatrixUser~ESCAPE_DEFAULT to change the default value.

    Returns MatrixUser

Properties

host: string
userId: string
ESCAPE_DEFAULT: boolean = true

Static

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

Accessors

  • get localpart(): string
  • Returns string

Methods

  • Get the data value for the given key.

    Returns

    Stored data for this key. May be undefined.

    Type Parameters

    • T

    Parameters

    • key: string

      An arbitrary bridge-specific key.

    Returns T

  • Get the display name for this Matrix user.

    Returns

    The display name.

    Returns null | string

  • Get the matrix user's ID.

    Returns

    The user ID

    Returns string

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

    Returns

    The serialised data

    Returns { localpart: string }

    • 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