aboutsummaryrefslogtreecommitdiff
path: root/lib/connection.cpp
diff options
context:
space:
mode:
authorAlexey Rusakov <Kitsune-Ral@users.sf.net>2022-05-30 15:24:02 +0200
committerAlexey Rusakov <Kitsune-Ral@users.sf.net>2022-05-30 15:24:02 +0200
commit078f5aab2e1eb1dea30828429069836509551b07 (patch)
treec47f13381689fb56d71be91843da281f44f36862 /lib/connection.cpp
parent999ec716d5e2b03aceb562e730edf3939eb2578a (diff)
downloadlibquotient-078f5aab2e1eb1dea30828429069836509551b07.tar.gz
libquotient-078f5aab2e1eb1dea30828429069836509551b07.zip
Cleanup and reformatting
Diffstat (limited to 'lib/connection.cpp')
-rw-r--r--lib/connection.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/lib/connection.cpp b/lib/connection.cpp
index b7f49546..102fb16d 100644
--- a/lib/connection.cpp
+++ b/lib/connection.cpp
@@ -387,7 +387,7 @@ public:
const QByteArray& sessionKey) const;
#endif
- void saveAccessTokenToKeychain()
+ void saveAccessTokenToKeychain() const
{
qCDebug(MAIN) << "Saving access token to keychain for" << q->userId();
auto job = new QKeychain::WritePasswordJob(qAppName());
@@ -593,11 +593,9 @@ void Connection::Private::loginToServer(LoginArgTs&&... loginArgs)
data->setDeviceId(loginJob->deviceId());
completeSetup(loginJob->userId());
saveAccessTokenToKeychain();
-#ifndef Quotient_E2EE_ENABLED
- qCWarning(E2EE) << "End-to-end encryption (E2EE) support is turned off.";
-#else // Quotient_E2EE_ENABLED
+#ifdef Quotient_E2EE_ENABLED
database->clear();
-#endif // Quotient_E2EE_ENABLED
+#endif
});
connect(loginJob, &BaseJob::failure, q, [this, loginJob] {
emit q->loginError(loginJob->errorString(), loginJob->rawDataSample());
@@ -654,9 +652,7 @@ void Connection::Private::completeSetup(const QString& mxId)
olmAccount = std::make_unique<QOlmAccount>(data->userId(), data->deviceId(), q);
connect(olmAccount.get(), &QOlmAccount::needsSave, q, &Connection::saveOlmAccount);
-#ifdef Quotient_E2EE_ENABLED
loadSessions();
-#endif
if (database->accountPickle().isEmpty()) {
// create new account and save unpickle data