aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTobias Fella <fella@posteo.de>2022-02-24 17:21:46 +0100
committerTobias Fella <fella@posteo.de>2022-02-24 17:21:46 +0100
commitcfa64f86da6fcfe04947a634a208705543824810 (patch)
treecefc6886bffdc3aab7838b36581b03661b24293d /lib
parent110ca4b01ae86216ee8c03cd2b4eda5ac351df2a (diff)
downloadlibquotient-cfa64f86da6fcfe04947a634a208705543824810.tar.gz
libquotient-cfa64f86da6fcfe04947a634a208705543824810.zip
Fix all tests
Diffstat (limited to 'lib')
-rw-r--r--lib/connection.cpp2
-rw-r--r--lib/database.cpp4
-rw-r--r--lib/database.h2
3 files changed, 4 insertions, 4 deletions
diff --git a/lib/connection.cpp b/lib/connection.cpp
index 1ef2495d..0ef27486 100644
--- a/lib/connection.cpp
+++ b/lib/connection.cpp
@@ -579,7 +579,7 @@ void Connection::Private::completeSetup(const QString& mxId)
picklingMode = Encrypted { job.binaryData() };
}
- database = new Database(data->userId(), q);
+ database = new Database(data->userId(), data->deviceId(), q);
// init olmAccount
olmAccount = std::make_unique<QOlmAccount>(data->userId(), data->deviceId(), q);
diff --git a/lib/database.cpp b/lib/database.cpp
index b91b6ef1..84c93046 100644
--- a/lib/database.cpp
+++ b/lib/database.cpp
@@ -15,7 +15,7 @@
#include "e2ee/qolminboundsession.h"
using namespace Quotient;
-Database::Database(const QString& matrixId, QObject* parent)
+Database::Database(const QString& matrixId, const QString& deviceId, QObject* parent)
: QObject(parent)
, m_matrixId(matrixId)
{
@@ -23,7 +23,7 @@ Database::Database(const QString& matrixId, QObject* parent)
QSqlDatabase::addDatabase(QStringLiteral("QSQLITE"), QStringLiteral("Quotient_%1").arg(m_matrixId));
QString databasePath = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + QStringLiteral("/%1").arg(m_matrixId);
QDir(databasePath).mkpath(databasePath);
- database().setDatabaseName(databasePath + QStringLiteral("/quotient.db3"));
+ database().setDatabaseName(databasePath + QStringLiteral("/quotient_%1.db3").arg(deviceId));
database().open();
switch(version()) {
diff --git a/lib/database.h b/lib/database.h
index d244dc0b..d4d5fb56 100644
--- a/lib/database.h
+++ b/lib/database.h
@@ -14,7 +14,7 @@ class QUOTIENT_API Database : public QObject
{
Q_OBJECT
public:
- Database(const QString& matrixId, QObject* parent);
+ Database(const QString& matrixId, const QString& deviceId, QObject* parent);
int version();
void transaction();