Options
All
  • Public
  • Public/Protected
  • All
Menu

An object controlling key verification requests.

Interactive verification flows usually start with a verification request, this object lets you send and reply to such a verification request.

After the initial handshake the verification flow transitions into one of the verification methods.

Hierarchy

  • VerificationRequest

Index

Constructors

Properties

cancelInfo: undefined | CancelInfo

Get info about the cancellation if the verification request has been cancelled.

flowId: string

Get the unique ID of this verification request.

otherDeviceId: undefined | DeviceId

The ID of the other device that is participating in this verification.

otherUserId: UserId

The ID of the other user that is participating in this verification request.

ourSupportedMethods: undefined | any[]

Get our own supported verification methods that we advertised.

Will be present only we requested the verification or if we’re in the ready state.

ownUserId: UserId

Our own user id.

roomId: undefined | RoomId

Get the room ID if the verification is happening inside a room.

theirSupportedMethods: undefined | any[]

Get the supported verification methods of the other side.

Will be present only if the other side requested the verification or if we’re in the ready state.

Returns

undefined if we do not yet know the supported methods; otherwise, an array of VerificationMethods.

Methods

  • accept(): any
  • Accept the verification request.

    This method will accept the request and signal that it supports the m.sas.v1, the m.qr_code.show.v1, and m.reciprocate.v1 method.

    m.qr_code.show.v1 will only be signaled if the qrcode feature is enabled. This feature is disabled by default. If it's enabled and QR code scanning should be supported or QR code showing shouldn't be supported the accept_with_methods method should be used instead.

    It returns either a ToDeviceRequest, a RoomMessageRequest or undefined.

    Returns any

  • acceptWithMethods(methods: any[]): any
  • Accept the verification request signaling that our client supports the given verification methods.

    methods represents the methods that we should advertise as supported by us.

    It returns either a ToDeviceRequest, a RoomMessageRequest or undefined.

    Parameters

    • methods: any[]

    Returns any

  • cancel(): any
  • Cancel the verification request.

    It returns either a ToDeviceRequest, a RoomMessageRequest or undefined.

    Returns any

  • free(): void
  • Returns void

  • generateQrCode(): Promise<any>
  • Generate a QR code that can be used by another client to start a QR code based verification.

    Returns a Qr or undefined.

    Returns Promise<any>

  • getVerification(): any
  • If this request has transitioned into a concrete verification flow (and not yet been completed or cancelled), returns a Verification object.

    Returns: a Sas, a Qr, or undefined.

    Returns any

  • isCancelled(): boolean
  • Has the verification flow that was started with this request been cancelled?

    Returns boolean

  • isDone(): boolean
  • Has the verification flow that was started with this request finished?

    Returns boolean

  • isPassive(): boolean
  • Has the verification request been answered by another device?

    Returns boolean

  • isReady(): boolean
  • Is the verification request ready to start a verification flow?

    Returns boolean

  • isSelfVerification(): boolean
  • Is this a verification that is verifying one of our own devices?

    Returns boolean

  • Get the current phase of this request.

    Returns a VerificationRequestPhase.

    Returns VerificationRequestPhase

  • registerChangesCallback(callback: Function): void
  • Register a callback which will be called whenever there is an update to the request.

    The callback is called with no parameters.

    Parameters

    • callback: Function

    Returns void

  • Start a QR code verification by providing a scanned QR code for this verification flow.

    Parameters

    Returns Promise<any>

  • startSas(): Promise<any>
  • Transition from this verification request into a SAS verification flow.

    Returns Promise<[Sas, RoomMessageRequest|ToDeviceRequest] | undefined>

    Returns Promise<any>

  • timeRemainingMillis(): number
  • The number of milliseconds remaining before this verification flow times out.

    Returns zero if the time has already passed.

    Returns number

  • timedOut(): boolean
  • Has the verification flow timed out?

    Returns boolean

  • weStarted(): boolean
  • Did we initiate the verification request?

    Returns boolean

  • request(own_user_id: UserId, own_device_id: DeviceId, other_user_id: UserId, methods?: any[]): string
  • Create an event content that can be sent as a room event to request verification from the other side. This should be used only for verifications of other users and it should be sent to a room we consider to be a DM with the other user.

    Parameters

    Returns string

Generated using TypeDoc