Skip to content

Commit

Permalink
Ensure requestedSize for avatars is valid
Browse files Browse the repository at this point in the history
Signed-off-by: Claudio Cambra <[email protected]>
  • Loading branch information
claucambra committed Oct 21, 2024
1 parent d7f7d94 commit 1479371
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/gui/tray/usermodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1649,7 +1649,8 @@ class ImageResponse : public QQuickImageResponse
qCWarning(lcActivity) << "Account not found:" << accountString;
return;
}
const auto avatarJob = new AvatarJob(accountState->account(), avatarUserId, requestedSize.width());
const auto avatarSize = requestedSize.width() > 0 ? requestedSize.width() : 64;
const auto avatarJob = new AvatarJob(accountState->account(), avatarUserId, avatarSize);
connect(avatarJob, &AvatarJob::avatarPixmap, this, [&](const QImage &avatarImg) {
handleDone(AvatarJob::makeCircularAvatar(avatarImg));
});
Expand Down

0 comments on commit 1479371

Please sign in to comment.