Change how room avatars are passed, fix friend avatars not loading
The problem lies in how media URLs work, in this case it the old NeoChatRoom::avatarMediaId could pass a mxc url *or* a path that can be put into root.connection.makeMediaUrl. So normal rooms with avatars loaded, but never friends because room members gave the mxc URL. Instead, change everything to use avatarMediaUrl which corrects this issue by always passing a mxc URL to QML. This also removes the need to call makeMediaUrl. Fixes #675
This commit is contained in:
@@ -431,9 +431,9 @@ QDateTime NeoChatRoom::lastActiveTime()
|
||||
return messageEvents().rbegin()->get()->originTimestamp();
|
||||
}
|
||||
|
||||
QString NeoChatRoom::avatarMediaId() const
|
||||
QUrl NeoChatRoom::avatarMediaUrl() const
|
||||
{
|
||||
if (const auto avatar = Room::avatarMediaId(); !avatar.isEmpty()) {
|
||||
if (const auto avatar = Room::avatarUrl(); !avatar.isEmpty()) {
|
||||
return avatar;
|
||||
}
|
||||
|
||||
@@ -441,7 +441,7 @@ QString NeoChatRoom::avatarMediaId() const
|
||||
const auto directChatMembers = this->directChatMembers();
|
||||
for (const auto member : directChatMembers) {
|
||||
if (member != localMember()) {
|
||||
return member.avatarMediaId();
|
||||
return member.avatarUrl();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user