Do heavy things less often on room change event

This commit is contained in:
Andreas Gattringer
2024-07-13 12:14:59 +02:00
parent 709711c3ca
commit b211f46e3e
2 changed files with 11 additions and 5 deletions

View File

@@ -47,7 +47,10 @@ void UserListModel::setRoom(NeoChatRoom *room)
connect(m_currentRoom, &Room::memberAvatarUpdated, this, [this](RoomMember member) {
refreshMember(member, {AvatarRole});
});
connect(m_currentRoom, &Room::changed, this, &UserListModel::refreshAllMembers);
connect(m_currentRoom, &Room::memberListChanged, this, [this]() {
// this is slow
UserListModel::refreshAllMembers();
});
connect(m_currentRoom->connection(), &Connection::loggedOut, this, [this]() {
setRoom(nullptr);
});