jamiaccount: allow to remove profile picture

Change-Id: Iba8066ea8131e458264b14ba46f16bdd0091ab91
This commit is contained in:
Adrien Beraud
2024-11-22 11:39:23 -05:00
committed by Adrien Béraud
parent b8bf25e0f9
commit 7e910b1cc7
2 changed files with 4 additions and 0 deletions

View File

@ -591,6 +591,7 @@
<ul> <ul>
<li>0 = modify avatar from path</li> <li>0 = modify avatar from path</li>
<li>1 = modify avatar from base64 img</li> <li>1 = modify avatar from base64 img</li>
<li>2 = remove avatar from profile</li>
</ul> </ul>
</tp:docstring> </tp:docstring>

View File

@ -3459,6 +3459,9 @@ JamiAccount::updateProfile(const std::string& displayName,
profile[key] = avatar; profile[key] = avatar;
} }
} }
if (flag == 2) {
vCard::utils::removeByKey(profile, "PHOTO");
}
try { try {
std::filesystem::path tmpPath = vCardPath.string() + ".tmp"; std::filesystem::path tmpPath = vCardPath.string() + ".tmp";
std::ofstream file(tmpPath); std::ofstream file(tmpPath);