Skip to content
Snippets Groups Projects
Commit e054fc95 authored by Sébastien Blin's avatar Sébastien Blin
Browse files

misc: fix missing account avatar

Change-Id: I69acb78e60e04f74382561e130185a1aca8064d6
parent 8305c0a0
No related branches found
No related tags found
No related merge requests found
...@@ -309,13 +309,15 @@ getAccountAvatar(const QString& accountId) ...@@ -309,13 +309,15 @@ getAccountAvatar(const QString& accountId)
QString filePath; QString filePath;
filePath = accountLocalPath + "profile.vcf"; filePath = accountLocalPath + "profile.vcf";
QFile file(filePath); QFile file(filePath);
if (!file.open(QIODevice::ReadOnly)) if (!file.open(QIODevice::ReadOnly)) {
return {}; return {};
}
const auto vCard = lrc::vCard::utils::toHashMap(file.readAll()); const auto vCard = lrc::vCard::utils::toHashMap(file.readAll());
const auto photo = (vCard.find(vCard::Property::PHOTO_PNG) == vCard.end()) for (const auto& key : vCard.keys()) {
? vCard[vCard::Property::PHOTO_JPEG] if (key.contains("PHOTO"))
: vCard[vCard::Property::PHOTO_PNG]; return vCard[key];
return photo; }
return {};
} }
static QPair<QString, QString> static QPair<QString, QString>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment