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

contactmodel: avoid crash on incorrect profile

Change-Id: I1aa09e72e7db602a489c1195ab45b897e18370bc
parent 2bf414e2
Branches
Tags nightly/20231222.0 nightly/20231222.1
No related merge requests found
......@@ -47,7 +47,7 @@ DEBIAN_DSC_FILENAME := jami_$(DEBIAN_VERSION).dsc
# Qt versions
QT_MAJOR := 6
QT_MINOR := 5
QT_PATCH := 3
QT_PATCH := 4
QT_TARBALL_CHECKSUM := 7cda4d119aad27a3887329cfc285f2aba5da85601212bcb0aea27bd6b7b544cb
DEBIAN_QT_VERSION := $(QT_MAJOR).$(QT_MINOR).$(QT_PATCH)-0
DEBIAN_QT_DSC_FILENAME := libqt-jami_$(DEBIAN_QT_VERSION).dsc
......
......@@ -1207,11 +1207,17 @@ ContactModelPimpl::slotProfileReceived(const QString& accountId,
profileInfo.uri = peer;
profileInfo.type = profile::Type::JAMI;
for (auto& e : QString(vCard).split("\n"))
if (e.contains("PHOTO"))
for (auto& e : QString(vCard).split("\n")) {
if (e.contains("PHOTO")) {
auto splitted = e.split(":");
if (splitted.size() > 1)
profileInfo.avatar = e.split(":")[1];
else if (e.contains("FN"))
} else if (e.contains("FN")) {
auto splitted = e.split(":");
if (splitted.size() > 1)
profileInfo.alias = e.split(":")[1];
}
}
if (peer == linked.owner.profileInfo.uri) {
auto avatarChanged = profileInfo.avatar != linked.owner.profileInfo.avatar;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment