support of the new managers in account code, new states, new lambdas, even launches now, even receives some bundles

This commit is contained in:
Blue 2022-12-27 01:01:01 +03:00
parent db3bc358a7
commit dfe72ca36c
Signed by: blue
GPG key ID: 9B203B252A63EE38
12 changed files with 113 additions and 25 deletions

View file

@ -31,7 +31,7 @@ Core::OmemoHandler::OmemoHandler(Account* account) :
db.open();
try {
QVariant own = meta->getRecord("ownDevice");
ownDevice.value() = own.value<OwnDevice>();
ownDevice = own.value<OwnDevice>();
qDebug() << "Successfully found own device omemo data for account" << acc->getName();
} catch (const DataBase::NotFound& e) {
qDebug() << "No device omemo data was found for account" << acc->getName();
@ -42,6 +42,10 @@ Core::OmemoHandler::~OmemoHandler() {
db.close();
}
bool Core::OmemoHandler::hasOwnDevice() {
return ownDevice.has_value();
}
QFuture<void> Core::OmemoHandler::emptyVoidFuture() {
QFutureInterface<QXmppOmemoStorage::OmemoData> result(QFutureInterfaceBase::Started);
result.reportFinished();
@ -101,7 +105,7 @@ QFuture<void> Core::OmemoHandler::addPreKeyPairs(const QHash<uint32_t, QByteArra
}
QFuture<void> Core::OmemoHandler::addSignedPreKeyPair(uint32_t keyId, const QXmppOmemoStorage::SignedPreKeyPair& keyPair) {
signedPreKeyPairs->addRecord(keyId, keyPair);
signedPreKeyPairs->forceRecord(keyId, keyPair);
return emptyVoidFuture();
}