aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTobias Fella <fella@posteo.de>2022-02-06 20:06:19 +0100
committerTobias Fella <fella@posteo.de>2022-02-06 20:06:19 +0100
commitef64359505778913235666f0e759dd0758f7f4ac (patch)
tree59b26b04be1811e6d8c1a57a6f09e4e079675f81 /lib
parent9960d33e0c2bbe4dd8f305cae3b01c2d704d28ff (diff)
downloadlibquotient-ef64359505778913235666f0e759dd0758f7f4ac.tar.gz
libquotient-ef64359505778913235666f0e759dd0758f7f4ac.zip
Only create one database
Diffstat (limited to 'lib')
-rw-r--r--lib/connection.cpp6
1 files changed, 1 insertions, 5 deletions
diff --git a/lib/connection.cpp b/lib/connection.cpp
index 54d79674..58e3a9f8 100644
--- a/lib/connection.cpp
+++ b/lib/connection.cpp
@@ -443,8 +443,6 @@ void Connection::Private::loginToServer(LoginArgTs&&... loginArgs)
#ifndef Quotient_E2EE_ENABLED
qCWarning(E2EE) << "End-to-end encryption (E2EE) support is turned off.";
#endif // Quotient_E2EE_ENABLED
- database = new Database(loginJob->userId(), q);
- database->clear();
});
connect(loginJob, &BaseJob::failure, q, [this, loginJob] {
emit q->loginError(loginJob->errorString(), loginJob->rawDataSample());
@@ -499,9 +497,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);
- if (!database) {
- database = new Database(data->userId(), q);
- }
+ database = new Database(data->userId(), q);
encryptionManager = new EncryptionManager(q);