mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-26 04:58:49 +03:00
Fix blurry avatars
They accidentally used the same state key...
This commit is contained in:
parent
1943d1c74d
commit
569c22b755
1 changed files with 4 additions and 3 deletions
|
@ -42,7 +42,7 @@ resolve(const QString &avatarUrl, int size, QObject *receiver, AvatarCallback ca
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto data = cache::image(avatarUrl);
|
auto data = cache::image(cacheKey);
|
||||||
if (!data.isNull()) {
|
if (!data.isNull()) {
|
||||||
pixmap.loadFromData(data);
|
pixmap.loadFromData(data);
|
||||||
avatar_cache.insert(cacheKey, pixmap);
|
avatar_cache.insert(cacheKey, pixmap);
|
||||||
|
@ -68,7 +68,8 @@ resolve(const QString &avatarUrl, int size, QObject *receiver, AvatarCallback ca
|
||||||
|
|
||||||
http::client()->get_thumbnail(
|
http::client()->get_thumbnail(
|
||||||
opts,
|
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) {
|
if (err) {
|
||||||
nhlog::net()->warn("failed to download avatar: {} - ({} {})",
|
nhlog::net()->warn("failed to download avatar: {} - ({} {})",
|
||||||
opts.mxc_url,
|
opts.mxc_url,
|
||||||
|
@ -77,7 +78,7 @@ resolve(const QString &avatarUrl, int size, QObject *receiver, AvatarCallback ca
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
cache::saveImage(opts.mxc_url, res);
|
cache::saveImage(cacheKey.toStdString(), res);
|
||||||
|
|
||||||
emit proxy->avatarDownloaded(QByteArray(res.data(), res.size()));
|
emit proxy->avatarDownloaded(QByteArray(res.data(), res.size()));
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue