aboutsummaryrefslogtreecommitdiff
path: root/lib/database.cpp
diff options
context:
space:
mode:
authorTobias Fella <fella@posteo.de>2021-12-07 19:09:14 +0100
committerTobias Fella <fella@posteo.de>2021-12-07 19:09:14 +0100
commit0f20fb028602016c718f4fd05cdb18b80442b3ca (patch)
tree5914fb5aa9e1ccce51a25de59c1621ae266893f4 /lib/database.cpp
parent2c6fa33ca52842e9dfba0dd3893a9d5526e10e60 (diff)
downloadlibquotient-0f20fb028602016c718f4fd05cdb18b80442b3ca.tar.gz
libquotient-0f20fb028602016c718f4fd05cdb18b80442b3ca.zip
id -> matrixId
Diffstat (limited to 'lib/database.cpp')
-rw-r--r--lib/database.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/database.cpp b/lib/database.cpp
index ec285d22..e115b6c3 100644
--- a/lib/database.cpp
+++ b/lib/database.cpp
@@ -89,11 +89,11 @@ void Database::migrateTo1()
commit();
}
-QByteArray Database::accountPickle(const QString &id)
+QByteArray Database::accountPickle(const QString &matrixId)
{
QSqlQuery query;
query.prepare(QStringLiteral("SELECT pickle FROM Accounts WHERE matrixId=:matrixId;"));
- query.bindValue(":matrixId", id);
+ query.bindValue(":matrixId", matrixId);
execute(query);
if (query.next()) {
return query.value(QStringLiteral("pickle")).toByteArray();
@@ -101,30 +101,30 @@ QByteArray Database::accountPickle(const QString &id)
return {};
}
-void Database::setAccountPickle(const QString &id, const QByteArray &pickle)
+void Database::setAccountPickle(const QString &matrixId, const QByteArray &pickle)
{
QSqlQuery query;
query.prepare(QStringLiteral("INSERT INTO Accounts(matrixId, pickle) VALUES(:matrixId, :pickle) ON CONFLICT (matrixId) DO UPDATE SET pickle=:pickle WHERE matrixId=:matrixId;"));
- query.bindValue(":matrixId", id);
+ query.bindValue(":matrixId", matrixId);
query.bindValue(":pickle", pickle);
transaction();
execute(query);
commit();
}
-void Database::clear(const QString &id)
+void Database::clear(const QString &matrixId)
{
QSqlQuery query;
query.prepare(QStringLiteral("DELETE FROM Accounts(matrixId, pickle) WHERE matrixId=:matrixId;"));
- query.bindValue(":matrixId", id);
+ query.bindValue(":matrixId", matrixId);
QSqlQuery sessionsQuery;
sessionsQuery.prepare(QStringLiteral("DELETE FROM OlmSessions WHERE matrixId=:matrixId;"));
- sessionsQuery.bindValue(":matrixId", id);
+ sessionsQuery.bindValue(":matrixId", matrixId);
QSqlQuery megolmSessionsQuery;
megolmSessionsQuery.prepare(QStringLiteral("DELETE FROM InboundMegolmSessions WHERE matrixId=:matrixId;"));
- megolmSessionsQuery.bindValue(":matrixId", id);
+ megolmSessionsQuery.bindValue(":matrixId", matrixId);
QSqlQuery groupSessionIndexRecordQuery;
groupSessionIndexRecordQuery.prepare(QStringLiteral("DELETE FROM GroupSessionIndexRecord WHERE matrixId=:matrixId;"));