summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2020-01-23 13:54:40 +0100
committerNicolas Werner <nicolas.werner@hotmail.de>2020-01-23 13:54:40 +0100
commit569c22b755948bf2388594c4b5855cb968d3f8e7 (patch)
tree118986ad07705df075f65519980cd6fcc4364a52 /src
parentIncrease emoji range (diff)
downloadnheko-569c22b755948bf2388594c4b5855cb968d3f8e7.tar.xz
Fix blurry avatars
They accidentally used the same state key...
Diffstat (limited to 'src')
-rw-r--r--src/AvatarProvider.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/AvatarProvider.cpp b/src/AvatarProvider.cpp
index 89496b20..d0556f85 100644
--- a/src/AvatarProvider.cpp
+++ b/src/AvatarProvider.cpp
@@ -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()));
           });