diff options
author | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2019-07-07 14:47:41 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-07 14:47:41 +0900 |
commit | 6c9d895c03b9d0e7ffbf5bace3994536ff3215be (patch) | |
tree | d80e9fe022e631d76fae641eddc264f7306996de /lib/connection.cpp | |
parent | f58819e4e930ee66e790eccaedf551f807956d72 (diff) | |
parent | d5b4e6440dae82eebc86657dd2f828edaf81b180 (diff) | |
download | libquotient-6c9d895c03b9d0e7ffbf5bace3994536ff3215be.tar.gz libquotient-6c9d895c03b9d0e7ffbf5bace3994536ff3215be.zip |
Merge pull request #329 from a-andreyev/aa13q-e2ee-enc-mng
E2EE: Introduce EncryptionManager with uploadIdentityKeys and uploadOneTimeKeys API.
Diffstat (limited to 'lib/connection.cpp')
-rw-r--r-- | lib/connection.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/connection.cpp b/lib/connection.cpp index 5d377173..20fb367c 100644 --- a/lib/connection.cpp +++ b/lib/connection.cpp @@ -23,6 +23,7 @@ #include "events/eventloader.h" #include "room.h" #include "settings.h" +#include "encryptionmanager.h" #include "csapi/login.h" #include "csapi/capabilities.h" #include "csapi/logout.h" @@ -102,6 +103,8 @@ class Connection::Private GetCapabilitiesJob* capabilitiesJob = nullptr; GetCapabilitiesJob::Capabilities capabilities; + QScopedPointer<EncryptionManager> encryptionManager; + SyncJob* syncJob = nullptr; bool cacheState = true; @@ -248,6 +251,13 @@ void Connection::doConnectToServer(const QString& user, const QString& password, [this, loginJob] { d->connectWithToken(loginJob->userId(), loginJob->accessToken(), loginJob->deviceId()); + + AccountSettings accountSettings(loginJob->userId()); + d->encryptionManager.reset(new EncryptionManager(accountSettings.encryptionAccountPickle())); + + d->encryptionManager->uploadIdentityKeys(this); + d->encryptionManager->uploadOneTimeKeys(this); + }); connect(loginJob, &BaseJob::failure, this, [this, loginJob] { |