aboutsummaryrefslogtreecommitdiff
path: root/lib/connection.cpp
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2019-07-07 14:47:41 +0900
committerGitHub <noreply@github.com>2019-07-07 14:47:41 +0900
commit6c9d895c03b9d0e7ffbf5bace3994536ff3215be (patch)
treed80e9fe022e631d76fae641eddc264f7306996de /lib/connection.cpp
parentf58819e4e930ee66e790eccaedf551f807956d72 (diff)
parentd5b4e6440dae82eebc86657dd2f828edaf81b180 (diff)
downloadlibquotient-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.cpp10
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] {