Options
All
  • Public
  • Public/Protected
  • All
Menu

QR code based verification.

Hierarchy

  • Qr

Index

Constructors

  • new Qr(): Qr
  • Returns Qr

Properties

flowId: string

Get the unique ID that identifies this QR verification flow, be either a to-device request ID or a room event ID.

otherDeviceId: DeviceId

Get the device ID of the other side.

otherUserId: UserId

Get the user id of the other user that is participating in this verification flow.

roomId: undefined | RoomId

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

userId: UserId

Get our own user ID.

Methods

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

    Returns either an OutgoingRequest which should be sent out, or undefined if the verification is already cancelled.

    Returns any

  • Get info about the cancellation if the verification flow has been cancelled.

    Returns undefined | CancelInfo

  • cancelWithCode(code: string): any
  • Cancel the verification.

    This cancels the verification with given code (e.g. m.user).

    Returns either an OutgoingRequest which should be sent out, or undefined if the verification is already cancelled.

    Parameters

    • code: string

    Returns any

  • confirmScanning(): any
  • Confirm that the other side has scanned our QR code.

    Returns either an OutgoingRequest which should be sent out, or undefined if the verification is already confirmed.

    Returns any

  • free(): void
  • Returns void

  • hasBeenConfirmed(): boolean
  • Has the scanning of the QR code been confirmed by us?

    Returns boolean

  • hasBeenScanned(): boolean
  • Has the QR verification been scanned by the other side.

    When the verification object is in this state it’s required that the user confirms that the other side has scanned the QR code.

    Returns boolean

  • isCancelled(): boolean
  • Has the verification flow been cancelled?

    Returns boolean

  • isDone(): boolean
  • Has the verification flow completed?

    Returns boolean

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

    Returns boolean

  • reciprocate(): any
  • Notify the other side that we have successfully scanned the QR code and that the QR verification flow can start.

    This will return some OutgoingContent if the object is in the correct state to start the verification flow, otherwise None.

    Returns any

  • reciprocated(): boolean
  • Have we successfully scanned the QR code and are able to send a reciprocation event?

    Returns boolean

  • 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

  • Get the current state of this request.

    Returns a QrState.

    Returns QrState

  • toBytes(): Uint8ClampedArray
  • Generate a the raw bytes that should be encoded as a QR code is representing this verification flow.

    The to_qr_code method can be used to instead output a QrCode object that can be rendered.

    Returns Uint8ClampedArray

  • Generate a QR code object that is representing this verification flow.

    The QrCode can then be rendered as an image or as an unicode string.

    The to_bytes method can be used to instead output the raw bytes that should be encoded as a QR code.

    Returns a QrCode.

    Returns QrCode

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

    Returns boolean

Generated using TypeDoc