From 832e6b9de04c117c215f8cc5bf4be7536e41fc8b Mon Sep 17 00:00:00 2001 From: James Graham Date: Fri, 28 Jun 2024 09:57:39 +0100 Subject: [PATCH] Make sure that the member object gets switched when a member's avatar or name is updated because the old state event will now be deleted and we need to ref the new one. --- src/models/userlistmodel.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/models/userlistmodel.cpp b/src/models/userlistmodel.cpp index 9caa9067a..21a606ef0 100644 --- a/src/models/userlistmodel.cpp +++ b/src/models/userlistmodel.cpp @@ -144,6 +144,8 @@ void UserListModel::refreshMember(const Quotient::RoomMember &member, const QLis { auto pos = findUserPos(member); if (pos != m_members.size()) { + // The update will have changed the state event so we need to insert the updated member object. + m_members.insert(pos, member); Q_EMIT dataChanged(index(pos), index(pos), roles); } else { qWarning() << "Trying to access a room member not in the user list";