Skip to content
Snippets Groups Projects
Commit f524c39c authored by Sébastien Blin's avatar Sébastien Blin Committed by Adrien Béraud
Browse files

contactmodel: do not save profile for account (managed by daemon)

Change-Id: I2943d91ad077892639a60117046665339e95d8fd
parent 2215d51f
No related branches found
No related tags found
No related merge requests found
......@@ -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();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment