Skip to content
Snippets Groups Projects
Commit 569c22b7 authored by Nicolas Werner's avatar Nicolas Werner
Browse files

Fix blurry avatars

They accidentally used the same state key...
parent 1943d1c7
No related branches found
No related tags found
No related merge requests found
......@@ -42,7 +42,7 @@ resolve(const QString &avatarUrl, int size, QObject *receiver, AvatarCallback ca
return;
}
auto data = cache::image(avatarUrl);
auto data = cache::image(cacheKey);
if (!data.isNull()) {
pixmap.loadFromData(data);
avatar_cache.insert(cacheKey, pixmap);
......@@ -68,7 +68,8 @@ resolve(const QString &avatarUrl, int size, QObject *receiver, AvatarCallback ca
http::client()->get_thumbnail(
opts,
[opts, proxy = std::move(proxy)](const std::string &res, mtx::http::RequestErr err) {
[opts, cacheKey, proxy = std::move(proxy)](const std::string &res,
mtx::http::RequestErr err) {
if (err) {
nhlog::net()->warn("failed to download avatar: {} - ({} {})",
opts.mxc_url,
......@@ -77,7 +78,7 @@ resolve(const QString &avatarUrl, int size, QObject *receiver, AvatarCallback ca
return;
}
cache::saveImage(opts.mxc_url, res);
cache::saveImage(cacheKey.toStdString(), res);
emit proxy->avatarDownloaded(QByteArray(res.data(), res.size()));
});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment