A key verification channel that sends verification events in the timeline of a room. Uses the event id of the initial m.key.verification.request event as a transaction id.

Hierarchy

  • InRoomChannel

Implements

Constructors

  • Parameters

    • client: MatrixClient

      the matrix client, to send messages with and get current user & device from.

    • roomId: string

      id of the room where verification events should be posted in, should be a DM with the given user.

    • Optional userId: string

      id of user that the verification request is directed at, should be present in the room.

    Returns InRoomChannel

Properties

client: MatrixClient

the matrix client, to send messages with and get current user & device from.

requestEventId?: string
roomId: string

id of the room where verification events should be posted in, should be a DM with the given user.

userId?: string

id of user that the verification request is directed at, should be present in the room.

Accessors

Methods

  • Add all the fields to content needed for sending it over this channel. This is public so verification methods (SAS uses this) can get the exact content that will be sent independent of the used channel, as they need to calculate the hash of it.

    Returns

    the complete content, as it will be sent.

    Parameters

    • type: string

      the event type

    • content: Record<string, any>

      the (incomplete) content

    Returns Record<string, any>

  • Send an event over the channel with the content not having gone through completeContent.

    Returns

    the promise of the request

    Parameters

    • type: string

      the event type

    • uncompletedContent: Record<string, any>

      the (incomplete) content

    Returns Promise<void>

  • Checks whether the given event type should be allowed to initiate a new VerificationRequest over this channel

    Returns

    boolean flag

    Parameters

    • type: string

      the event type to check

    Returns boolean

  • As m.key.verification.request events are as m.room.message events with the InRoomChannel to have a fallback message in non-supporting clients, we map the real event type to the symbolic one to keep things in unison with ToDeviceChannel

    Returns

    the "symbolic" event type

    Parameters

    Returns string

  • Checks whether this event is a well-formed key verification event. This only does checks that don't rely on the current state of a potentially already channel so we can prevent channels being created by invalid events. handleEvent can do more checks and choose to ignore invalid events.

    Returns

    whether the event is valid and should be passed to handleEvent

    Parameters

    • event: MatrixEvent

      the event to validate

    • client: MatrixClient

      the client to get the current user and device id from

    Returns boolean

Generated using TypeDoc