aboutsummaryrefslogtreecommitdiff
path: root/lib/database.h
diff options
context:
space:
mode:
authorTobias Fella <fella@posteo.de>2022-03-06 22:54:01 +0100
committerTobias Fella <fella@posteo.de>2022-05-16 20:47:17 +0200
commit6f5ac9b7315d75692960e5eac7b1eb6867c0d203 (patch)
treef20f68dbf9ff687f212c7e074802c80370ef53dd /lib/database.h
parent3eb7ad8b0a1ac0f6f9cda679108937a01268f184 (diff)
downloadlibquotient-6f5ac9b7315d75692960e5eac7b1eb6867c0d203.tar.gz
libquotient-6f5ac9b7315d75692960e5eac7b1eb6867c0d203.zip
Keep log of where we send keys and send keys to new devices and users
Diffstat (limited to 'lib/database.h')
-rw-r--r--lib/database.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/database.h b/lib/database.h
index 751ebd1d..30f2f203 100644
--- a/lib/database.h
+++ b/lib/database.h
@@ -7,9 +7,14 @@
#include <QtSql/QSqlQuery>
#include <QtCore/QVector>
+#include <QtCore/QHash>
+
#include "e2ee/e2ee.h"
namespace Quotient {
+class User;
+class Room;
+
class QUOTIENT_API Database : public QObject
{
Q_OBJECT
@@ -38,6 +43,10 @@ public:
QOlmOutboundGroupSessionPtr loadCurrentOutboundMegolmSession(const QString& roomId, const PicklingMode& picklingMode);
void saveCurrentOutboundMegolmSession(const QString& roomId, const PicklingMode& picklingMode, const QOlmOutboundGroupSessionPtr& data);
+ // Returns a map User -> [Device] that have not received key yet
+ QHash<QString, QStringList> devicesWithoutKey(Room* room, const QString &sessionId);
+ void setDevicesReceivedKey(const QString& roomId, QHash<User *, QStringList> devices, const QString& sessionId, int index);
+
private:
void migrateTo1();
void migrateTo2();