diff options
author | Tobias Fella <fella@posteo.de> | 2021-08-17 20:51:29 +0200 |
---|---|---|
committer | Tobias Fella <fella@posteo.de> | 2021-12-01 21:56:59 +0100 |
commit | 244938d2c99674ba09f3c1f92b2a4f8507ac5e58 (patch) | |
tree | 3f3ecc52b52dcb771242213e8043004278a2257c /lib/room.cpp | |
parent | 60bd11426e941f9d349962b8b2ea4bddd9488965 (diff) | |
download | libquotient-244938d2c99674ba09f3c1f92b2a4f8507ac5e58.tar.gz libquotient-244938d2c99674ba09f3c1f92b2a4f8507ac5e58.zip |
Various fixes
Diffstat (limited to 'lib/room.cpp')
-rw-r--r-- | lib/room.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/room.cpp b/lib/room.cpp index 5fedd861..a1354fc5 100644 --- a/lib/room.cpp +++ b/lib/room.cpp @@ -372,7 +372,7 @@ public: std::map<QPair<QString, QString>, std::unique_ptr<QOlmInboundGroupSession>> groupSessions; void loadMegOlmSessions() { - QFile file { connection->stateCacheDir().filePath("megolmsessions.json") }; + QFile file { connection->stateCacheDir().filePath(QStringLiteral("megolm/%1.json").arg(id)) }; if(!file.exists() || !file.open(QIODevice::ReadOnly)) { qCDebug(E2EE) << "No megolm sessions cache exists."; return; @@ -387,7 +387,7 @@ public: #endif ; if (json.isEmpty()) { - qCWarning(MAIN) << "Megolm sessions cache is empty"; + qCWarning(E2EE) << "Megolm sessions cache is empty"; return; } for(const auto &s : json["sessions"].toArray()) { @@ -403,7 +403,8 @@ public: } } void saveMegOlmSessions() { - QFile outFile { connection->stateCacheDir().filePath("megolmsessions.json") }; + connection->stateCacheDir().mkdir("megolm"); + QFile outFile { connection->stateCacheDir().filePath(QStringLiteral("megolm/%1.json").arg(id))}; if (!outFile.open(QFile::WriteOnly)) { qCWarning(E2EE) << "Error opening" << outFile.fileName() << ":" << outFile.errorString(); @@ -521,6 +522,7 @@ Room::Room(Connection* connection, QString id, JoinState initialJoinState) return this == r; // loadedRoomState fires only once per room }); qCDebug(STATE) << "New" << initialJoinState << "Room:" << id; + #ifdef Quotient_E2EE_ENABLED connectSingleShot(this, &Room::encryption, this, [=](){ connection->encryptionUpdate(this); |