A key verification channel that sends verification events over to_device messages. Generates its own transaction ids.

Hierarchy

  • ToDeviceChannel

Implements

Constructors

Properties

client: MatrixClient
deviceId?: string
devices: string[]
transactionId?: string
userId: string

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

  • 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