Merge pull request #1796 from Bilb/fix-profile-name-update-without-profile-key

fix a bug not making profile name updates in opengroup
pull/1797/head
Audric Ackermann 4 years ago committed by GitHub
commit d236ef9cde
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -47,14 +47,9 @@ async function updateProfile(
// Retain old values unless changed: // Retain old values unless changed:
const newProfile = conversation.get('profile') || {}; const newProfile = conversation.get('profile') || {};
if (!profileKey) {
window.log.warn("No need to try to update profile. We don't have a profile key");
return;
}
newProfile.displayName = profile.displayName; newProfile.displayName = profile.displayName;
if (profile.profilePicture) { if (profile.profilePicture && profileKey) {
const prevPointer = conversation.get('avatarPointer'); const prevPointer = conversation.get('avatarPointer');
const needsUpdate = !prevPointer || !_.isEqual(prevPointer, profile.profilePicture); const needsUpdate = !prevPointer || !_.isEqual(prevPointer, profile.profilePicture);
@ -97,7 +92,7 @@ async function updateProfile(
return; return;
} }
} }
} else { } else if (profileKey) {
newProfile.avatar = null; newProfile.avatar = null;
} }

Loading…
Cancel
Save