From 5de778ea82ab430fda7eb6937b0208399d02db13 Mon Sep 17 00:00:00 2001 From: Tobias Fella Date: Sun, 1 Nov 2020 20:11:09 +0100 Subject: [PATCH] Fix compilation against newer libQuotient --- src/userlistmodel.cpp | 9 +++------ src/userlistmodel.h | 2 +- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/userlistmodel.cpp b/src/userlistmodel.cpp index 9a24f161a..372c542a9 100644 --- a/src/userlistmodel.cpp +++ b/src/userlistmodel.cpp @@ -42,7 +42,7 @@ void UserListModel::setRoom(Quotient::Room* room) { std::sort(m_users.begin(), m_users.end(), room->memberSorter()); } for (User* user : m_users) { - connect(user, &User::avatarChanged, this, &UserListModel::avatarChanged); + connect(user, &User::defaultAvatarChanged, this, [user, this](){avatarChanged(user);}); } connect(m_currentRoom->connection(), &Connection::loggedOut, this, [=] { setRoom(nullptr); }); @@ -134,8 +134,7 @@ void UserListModel::userAdded(Quotient::User* user) { beginInsertRows(QModelIndex(), pos, pos); m_users.insert(pos, user); endInsertRows(); - connect(user, &Quotient::User::avatarChanged, this, - &UserListModel::avatarChanged); + connect(user, &Quotient::User::defaultAvatarChanged, this, [user, this](){avatarChanged(user);}); } void UserListModel::userRemoved(Quotient::User* user) { @@ -157,9 +156,7 @@ void UserListModel::refresh(Quotient::User* user, QVector roles) { qWarning() << "Trying to access a room member not in the user list"; } -void UserListModel::avatarChanged(Quotient::User* user, - const Quotient::Room* context) { - if (context == m_currentRoom) +void UserListModel::avatarChanged(Quotient::User* user) { refresh(user, {AvatarRole}); } diff --git a/src/userlistmodel.h b/src/userlistmodel.h index c223aed91..74b2af70e 100644 --- a/src/userlistmodel.h +++ b/src/userlistmodel.h @@ -57,7 +57,7 @@ class UserListModel : public QAbstractListModel { void userAdded(Quotient::User* user); void userRemoved(Quotient::User* user); void refresh(Quotient::User* user, QVector roles = {}); - void avatarChanged(Quotient::User* user, const Quotient::Room* context); + void avatarChanged(Quotient::User* user); private: Quotient::Room* m_currentRoom;