From f524c39c5fd4baa5da06f806a38a58b6ba0a4bfd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Blin?= <sebastien.blin@savoirfairelinux.com> Date: Wed, 27 Dec 2023 10:07:50 -0500 Subject: [PATCH] contactmodel: do not save profile for account (managed by daemon) Change-Id: I2943d91ad077892639a60117046665339e95d8fd --- src/libclient/contactmodel.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/libclient/contactmodel.cpp b/src/libclient/contactmodel.cpp index 5d030e4e4..5ec247038 100644 --- a/src/libclient/contactmodel.cpp +++ b/src/libclient/contactmodel.cpp @@ -1220,15 +1220,11 @@ ContactModelPimpl::slotProfileReceived(const QString& accountId, } if (peer == linked.owner.profileInfo.uri) { - auto avatarChanged = profileInfo.avatar != linked.owner.profileInfo.avatar; - auto aliasChanged = profileInfo.alias != linked.owner.profileInfo.alias; if (profileInfo.avatar.isEmpty()) return; // In this case, probably a new device without avatar. - // Only save the new profile once - if (aliasChanged) - linked.owner.accountModel->setAlias(linked.owner.id, profileInfo.alias, !avatarChanged); - if (avatarChanged) - linked.owner.accountModel->setAvatar(linked.owner.id, profileInfo.avatar, true); + // Profile is saved by daemon, just update client + linked.owner.accountModel->setAlias(linked.owner.id, profileInfo.alias, false); + linked.owner.accountModel->setAvatar(linked.owner.id, profileInfo.avatar, false); return; } vCardFile.remove(); -- GitLab