aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Fella <fella@posteo.de>2021-05-19 22:25:50 +0200
committerTobias Fella <fella@posteo.de>2021-12-01 21:56:11 +0100
commitf451813f21a76e8c011bbd27f4ded1d31044a572 (patch)
treeb7020475613e6aae04193405e9f4ae8c9167f3ce
parentc408b460bea2010c6745e03c549e136d6b1d9ec6 (diff)
downloadlibquotient-f451813f21a76e8c011bbd27f4ded1d31044a572.tar.gz
libquotient-f451813f21a76e8c011bbd27f4ded1d31044a572.zip
Update tracked users list when new user joins encrypted room
-rw-r--r--lib/connection.cpp2
-rw-r--r--lib/room.cpp7
2 files changed, 7 insertions, 2 deletions
diff --git a/lib/connection.cpp b/lib/connection.cpp
index 2864f3b3..b87610b7 100644
--- a/lib/connection.cpp
+++ b/lib/connection.cpp
@@ -1862,7 +1862,7 @@ void Connection::Private::loadOutdatedUserDevices()
});
}
-void Connection::newEncryptedRoom(Room *room)
+void Connection::encryptionUpdate(Room *room)
{
for(const auto &user : room->users()) {
if(!d->trackedUsers.contains(user->id())) {
diff --git a/lib/room.cpp b/lib/room.cpp
index b6022f1b..2707842c 100644
--- a/lib/room.cpp
+++ b/lib/room.cpp
@@ -476,7 +476,12 @@ Room::Room(Connection* connection, QString id, JoinState initialJoinState)
return this == r; // loadedRoomState fires only once per room
});
connectSingleShot(this, &Room::encryption, this, [=](){
- connection->newEncryptedRoom(this);
+ connection->encryptionUpdate(this);
+ });
+ connect(this, &Room::userAdded, this, [=](){
+ if(usesEncryption()) {
+ connection->encryptionUpdate(this);
+ }
});
qCDebug(STATE) << "New" << terse << initialJoinState << "Room:" << id;
}