diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/connection.cpp | 13 | ||||
-rw-r--r-- | lib/room.cpp | 3 |
2 files changed, 16 insertions, 0 deletions
diff --git a/lib/connection.cpp b/lib/connection.cpp index 8ceb2a44..2864f3b3 100644 --- a/lib/connection.cpp +++ b/lib/connection.cpp @@ -1861,4 +1861,17 @@ void Connection::Private::loadOutdatedUserDevices() } }); } + +void Connection::newEncryptedRoom(Room *room) +{ + for(const auto &user : room->users()) { + if(!d->trackedUsers.contains(user->id())) { + d->trackedUsers += user->id(); + d->outdatedUsers += user->id(); + } + } + if(!d->outdatedUsers.isEmpty()) { + d->loadOutdatedUserDevices(); + } +} #endif diff --git a/lib/room.cpp b/lib/room.cpp index 1a7a9911..b6022f1b 100644 --- a/lib/room.cpp +++ b/lib/room.cpp @@ -475,6 +475,9 @@ Room::Room(Connection* connection, QString id, JoinState initialJoinState) emit baseStateLoaded(); return this == r; // loadedRoomState fires only once per room }); + connectSingleShot(this, &Room::encryption, this, [=](){ + connection->newEncryptedRoom(this); + }); qCDebug(STATE) << "New" << terse << initialJoinState << "Room:" << id; } |