From e8f4323b5c1dbdc011f89187b5fd238f0f8dd74b Mon Sep 17 00:00:00 2001 From: Sergei Ilinykh Date: Fri, 14 Jun 2024 00:50:39 +0300 Subject: [PATCH] Fix disappearing avatars in infodlg on refresh --- src/infodlg.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/infodlg.cpp b/src/infodlg.cpp index 0108f5d04..c749010a8 100644 --- a/src/infodlg.cpp +++ b/src/infodlg.cpp @@ -454,7 +454,14 @@ void InfoWidget::setData(const VCard4::VCard &i) auto pix = d->pa->avatarFactory()->getAvatar(d->jid); if (pix.isNull()) { - clearPhoto(); + d->photo = i.photo(); + if (d->photo.isEmpty()) { + clearPhoto(); + } else { + // FIXME ideally we should come here after avatar factory is updated + // the this code would be unnecessary + updatePhoto(); + } } else { // yes we could use pixmap directly. let's keep it for future code optimization QByteArray ba;