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

#include <database.h>

Public Member Functions

 Database (const QString &userId, const QString &deviceId, PicklingKey &&picklingKey)
 
int version ()
 
void transaction ()
 
void commit ()
 
QSqlQuery execute (const QString &queryString)
 
void execute (QSqlQuery &query)
 
QSqlDatabase database () const
 
QSqlQuery prepareQuery (const QString &queryString) const
 
void storeOlmAccount (const QOlmAccount &olmAccount)
 
std::optional< OlmErrorCode > setupOlmAccount (QOlmAccount &olmAccount)
 
void clear ()
 
void saveOlmSession (const QByteArray &senderKey, const QOlmSession &session, const QDateTime &timestamp)
 
std::unordered_map< QByteArray, std::vector< QOlmSession > > loadOlmSessions ()
 
std::unordered_map< QByteArray, QOlmInboundGroupSessionloadMegolmSessions (const QString &roomId)
 
void saveMegolmSession (const QString &roomId, const QOlmInboundGroupSession &session, const QByteArray &senderKey, const QByteArray &senderClaimedEdKey)
 
void addGroupSessionIndexRecord (const QString &roomId, const QString &sessionId, uint32_t index, const QString &eventId, qint64 ts)
 
std::pair< QString, qint64 > groupSessionIndexRecord (const QString &roomId, const QString &sessionId, qint64 index)
 
void clearRoomData (const QString &roomId)
 
void setOlmSessionLastReceived (const QByteArray &sessionId, const QDateTime &timestamp)
 
std::optional< QOlmOutboundGroupSessionloadCurrentOutboundMegolmSession (const QString &roomId)
 
void saveCurrentOutboundMegolmSession (const QString &roomId, const QOlmOutboundGroupSession &session)
 
void updateOlmSession (const QByteArray &senderKey, const QOlmSession &session)
 
QMultiHash< QString, QString > devicesWithoutKey (const QString &roomId, QMultiHash< QString, QString > devices, const QByteArray &sessionId)
 
void setDevicesReceivedKey (const QString &roomId, const QVector< std::tuple< QString, QString, QString >> &devices, const QByteArray &sessionId, uint32_t index)
 
bool isSessionVerified (const QString &edKey)
 
void setSessionVerified (const QString &edKeyId)
 
void setMasterKeyVerified (const QString &masterKey)
 
QString edKeyForKeyId (const QString &userId, const QString &edKeyId)
 
void storeEncrypted (const QString &name, const QByteArray &key)
 
QByteArray loadEncrypted (const QString &name)
 
QString userSigningPublicKey ()
 
QString selfSigningPublicKey ()
 
QString edKeyForMegolmSession (const QString &sessionId)
 
QString senderKeyForMegolmSession (const QString &sessionId)
 

Detailed Description

Definition at line 21 of file database.h.

Constructor & Destructor Documentation

◆ Database()

Quotient::Database::Database ( const QString &  userId,
const QString &  deviceId,
PicklingKey &&  picklingKey 
)

Member Function Documentation

◆ addGroupSessionIndexRecord()

void Quotient::Database::addGroupSessionIndexRecord ( const QString &  roomId,
const QString &  sessionId,
uint32_t  index,
const QString &  eventId,
qint64  ts 
)

◆ clear()

void Quotient::Database::clear ( )

◆ clearRoomData()

void Quotient::Database::clearRoomData ( const QString &  roomId)

◆ commit()

void Quotient::Database::commit ( )

◆ database()

QSqlDatabase Quotient::Database::database ( ) const

◆ devicesWithoutKey()

QMultiHash<QString, QString> Quotient::Database::devicesWithoutKey ( const QString &  roomId,
QMultiHash< QString, QString >  devices,
const QByteArray &  sessionId 
)

◆ edKeyForKeyId()

QString Quotient::Database::edKeyForKeyId ( const QString &  userId,
const QString &  edKeyId 
)

◆ edKeyForMegolmSession()

QString Quotient::Database::edKeyForMegolmSession ( const QString &  sessionId)

◆ execute() [1/2]

QSqlQuery Quotient::Database::execute ( const QString &  queryString)

◆ execute() [2/2]

void Quotient::Database::execute ( QSqlQuery &  query)

◆ groupSessionIndexRecord()

std::pair<QString, qint64> Quotient::Database::groupSessionIndexRecord ( const QString &  roomId,
const QString &  sessionId,
qint64  index 
)

◆ isSessionVerified()

bool Quotient::Database::isSessionVerified ( const QString &  edKey)

◆ loadCurrentOutboundMegolmSession()

std::optional<QOlmOutboundGroupSession> Quotient::Database::loadCurrentOutboundMegolmSession ( const QString &  roomId)

◆ loadEncrypted()

QByteArray Quotient::Database::loadEncrypted ( const QString &  name)

◆ loadMegolmSessions()

std::unordered_map<QByteArray, QOlmInboundGroupSession> Quotient::Database::loadMegolmSessions ( const QString &  roomId)

◆ loadOlmSessions()

std::unordered_map<QByteArray, std::vector<QOlmSession> > Quotient::Database::loadOlmSessions ( )

◆ prepareQuery()

QSqlQuery Quotient::Database::prepareQuery ( const QString &  queryString) const

◆ saveCurrentOutboundMegolmSession()

void Quotient::Database::saveCurrentOutboundMegolmSession ( const QString &  roomId,
const QOlmOutboundGroupSession session 
)

◆ saveMegolmSession()

void Quotient::Database::saveMegolmSession ( const QString &  roomId,
const QOlmInboundGroupSession session,
const QByteArray &  senderKey,
const QByteArray &  senderClaimedEdKey 
)

◆ saveOlmSession()

void Quotient::Database::saveOlmSession ( const QByteArray &  senderKey,
const QOlmSession session,
const QDateTime &  timestamp 
)

◆ selfSigningPublicKey()

QString Quotient::Database::selfSigningPublicKey ( )

◆ senderKeyForMegolmSession()

QString Quotient::Database::senderKeyForMegolmSession ( const QString &  sessionId)

◆ setDevicesReceivedKey()

void Quotient::Database::setDevicesReceivedKey ( const QString &  roomId,
const QVector< std::tuple< QString, QString, QString >> &  devices,
const QByteArray &  sessionId,
uint32_t  index 
)

◆ setMasterKeyVerified()

void Quotient::Database::setMasterKeyVerified ( const QString &  masterKey)

◆ setOlmSessionLastReceived()

void Quotient::Database::setOlmSessionLastReceived ( const QByteArray &  sessionId,
const QDateTime &  timestamp 
)

◆ setSessionVerified()

void Quotient::Database::setSessionVerified ( const QString &  edKeyId)

◆ setupOlmAccount()

std::optional<OlmErrorCode> Quotient::Database::setupOlmAccount ( QOlmAccount olmAccount)

◆ storeEncrypted()

void Quotient::Database::storeEncrypted ( const QString &  name,
const QByteArray &  key 
)

◆ storeOlmAccount()

void Quotient::Database::storeOlmAccount ( const QOlmAccount olmAccount)

◆ transaction()

void Quotient::Database::transaction ( )

◆ updateOlmSession()

void Quotient::Database::updateOlmSession ( const QByteArray &  senderKey,
const QOlmSession session 
)

◆ userSigningPublicKey()

QString Quotient::Database::userSigningPublicKey ( )

◆ version()

int Quotient::Database::version ( )

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