1
0
Fork 0
mirror of https://git.jami.net/savoirfairelinux/jami-client-qt.git synced 2025-03-28 14:56:19 +01:00

contactmodel: avoid crash on incorrect profile

Change-Id: I1aa09e72e7db602a489c1195ab45b897e18370bc
This commit is contained in:
Sébastien Blin 2023-12-22 09:54:22 -05:00
parent 2bf414e27e
commit 93d2201277
2 changed files with 12 additions and 6 deletions

View file

@ -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

View file

@ -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"))
profileInfo.avatar = e.split(":")[1];
else if (e.contains("FN"))
profileInfo.alias = e.split(":")[1];
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")) {
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;