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>

  • 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