libQuotient
A Qt library for building matrix clients
Quotient::KeyVerificationSession Class Reference

#include <keyverificationsession.h>

Inheritance diagram for Quotient::KeyVerificationSession:
Collaboration diagram for Quotient::KeyVerificationSession:

Public Types

enum  State {
  INCOMING , WAITINGFORREADY , READY , WAITINGFORACCEPT ,
  ACCEPTED , WAITINGFORKEY , WAITINGFORVERIFICATION , WAITINGFORMAC ,
  CANCELED , DONE
}
 
enum  Error {
  NONE , TIMEOUT , REMOTE_TIMEOUT , USER ,
  REMOTE_USER , UNEXPECTED_MESSAGE , REMOTE_UNEXPECTED_MESSAGE , UNKNOWN_TRANSACTION ,
  REMOTE_UNKNOWN_TRANSACTION , UNKNOWN_METHOD , REMOTE_UNKNOWN_METHOD , KEY_MISMATCH ,
  REMOTE_KEY_MISMATCH , USER_MISMATCH , REMOTE_USER_MISMATCH , INVALID_MESSAGE ,
  REMOTE_INVALID_MESSAGE , SESSION_ACCEPTED , REMOTE_SESSION_ACCEPTED , MISMATCHED_COMMITMENT ,
  REMOTE_MISMATCHED_COMMITMENT , MISMATCHED_SAS , REMOTE_MISMATCHED_SAS
}
 

Public Slots

void sendRequest ()
 
void sendReady ()
 
void sendMac ()
 
void sendStartSas ()
 
void sendKey ()
 
void sendDone ()
 
void cancelVerification (Error error)
 

Signals

void keyReceived ()
 
void sasEmojisChanged ()
 
void stateChanged ()
 
void errorChanged ()
 
void finished ()
 

Public Member Functions

 KeyVerificationSession (QString remoteUserId, const KeyVerificationRequestEvent &event, Connection *connection, bool encrypted)
 
 KeyVerificationSession (QString userId, QString deviceId, Connection *connection)
 
 KeyVerificationSession (const RoomMessageEvent *event, Room *room)
 
 KeyVerificationSession (Room *room)
 
void handleEvent (const KeyVerificationEvent &baseEvent)
 
QVector< EmojiEntrysasEmojis () const
 
State state () const
 
Error error () const
 
QString remoteDeviceId () const
 
QString transactionId () const
 
bool userVerification () const
 
void setRequestEventId (const QString &eventId)
 

Properties

QString remoteDeviceId
 
QString remoteUserId
 
QVector< EmojiEntrysasEmojis
 
State state
 
Error error
 
bool userVerification
 

Detailed Description

A key verification session. Listen for incoming sessions by connecting to Connection::newKeyVerificationSession. Start a new session using Connection::startKeyVerificationSession. The object is delete after finished is emitted.

Definition at line 34 of file keyverificationsession.h.

Member Enumeration Documentation

◆ Error

Enumerator
NONE 
TIMEOUT 
REMOTE_TIMEOUT 
USER 
REMOTE_USER 
UNEXPECTED_MESSAGE 
REMOTE_UNEXPECTED_MESSAGE 
UNKNOWN_TRANSACTION 
REMOTE_UNKNOWN_TRANSACTION 
UNKNOWN_METHOD 
REMOTE_UNKNOWN_METHOD 
KEY_MISMATCH 
REMOTE_KEY_MISMATCH 
USER_MISMATCH 
REMOTE_USER_MISMATCH 
INVALID_MESSAGE 
REMOTE_INVALID_MESSAGE 
SESSION_ACCEPTED 
REMOTE_SESSION_ACCEPTED 
MISMATCHED_COMMITMENT 
REMOTE_MISMATCHED_COMMITMENT 
MISMATCHED_SAS 
REMOTE_MISMATCHED_SAS 

Definition at line 57 of file keyverificationsession.h.

◆ State

Enumerator
INCOMING 

There is a request for verification incoming

WAITINGFORREADY 

We sent a request for verification and are waiting for ready.

READY 

Either party sent a ready as a response to a request; the user selects a method

WAITINGFORACCEPT 

We sent a start and are waiting for an accept.

ACCEPTED 

The other party sent an accept and is waiting for a key.

WAITINGFORKEY 

We're waiting for a key

WAITINGFORVERIFICATION 

We're waiting for the user to verify the emojis.

WAITINGFORMAC 

We're waiting for the mac.

CANCELED 

The session has been canceled.

DONE 

The verification is done.

Definition at line 39 of file keyverificationsession.h.

Constructor & Destructor Documentation

◆ KeyVerificationSession() [1/4]

Quotient::KeyVerificationSession::KeyVerificationSession ( QString  remoteUserId,
const KeyVerificationRequestEvent event,
Connection connection,
bool  encrypted 
)

◆ KeyVerificationSession() [2/4]

Quotient::KeyVerificationSession::KeyVerificationSession ( QString  userId,
QString  deviceId,
Connection connection 
)

◆ KeyVerificationSession() [3/4]

Quotient::KeyVerificationSession::KeyVerificationSession ( const RoomMessageEvent event,
Room room 
)

◆ KeyVerificationSession() [4/4]

Quotient::KeyVerificationSession::KeyVerificationSession ( Room room)
explicit

Member Function Documentation

◆ cancelVerification

void Quotient::KeyVerificationSession::cancelVerification ( Error  error)
slot

◆ error()

Error Quotient::KeyVerificationSession::error ( ) const

◆ errorChanged

void Quotient::KeyVerificationSession::errorChanged ( )
signal

◆ finished

void Quotient::KeyVerificationSession::finished ( )
signal

◆ handleEvent()

void Quotient::KeyVerificationSession::handleEvent ( const KeyVerificationEvent baseEvent)

◆ keyReceived

void Quotient::KeyVerificationSession::keyReceived ( )
signal

◆ remoteDeviceId()

QString Quotient::KeyVerificationSession::remoteDeviceId ( ) const

◆ sasEmojis()

QVector<EmojiEntry> Quotient::KeyVerificationSession::sasEmojis ( ) const

◆ sasEmojisChanged

void Quotient::KeyVerificationSession::sasEmojisChanged ( )
signal

◆ sendDone

void Quotient::KeyVerificationSession::sendDone ( )
slot

◆ sendKey

void Quotient::KeyVerificationSession::sendKey ( )
slot

◆ sendMac

void Quotient::KeyVerificationSession::sendMac ( )
slot

◆ sendReady

void Quotient::KeyVerificationSession::sendReady ( )
slot

◆ sendRequest

void Quotient::KeyVerificationSession::sendRequest ( )
slot

◆ sendStartSas

void Quotient::KeyVerificationSession::sendStartSas ( )
slot

◆ setRequestEventId()

void Quotient::KeyVerificationSession::setRequestEventId ( const QString &  eventId)

◆ state()

State Quotient::KeyVerificationSession::state ( ) const

◆ stateChanged

void Quotient::KeyVerificationSession::stateChanged ( )
signal

◆ transactionId()

QString Quotient::KeyVerificationSession::transactionId ( ) const

◆ userVerification()

bool Quotient::KeyVerificationSession::userVerification ( ) const

Property Documentation

◆ error

Error Quotient::KeyVerificationSession::error
read

Definition at line 27 of file keyverificationsession.h.

◆ remoteDeviceId

QString Quotient::KeyVerificationSession::remoteDeviceId

Definition at line 27 of file keyverificationsession.h.

◆ remoteUserId

QString Quotient::KeyVerificationSession::remoteUserId

Definition at line 27 of file keyverificationsession.h.

◆ sasEmojis

QVector<EmojiEntry> Quotient::KeyVerificationSession::sasEmojis
read

Definition at line 27 of file keyverificationsession.h.

◆ state

State Quotient::KeyVerificationSession::state
read

Definition at line 27 of file keyverificationsession.h.

◆ userVerification

bool Quotient::KeyVerificationSession::userVerification
read

Definition at line 27 of file keyverificationsession.h.


The documentation for this class was generated from the following file: