Allow requesting profile without profileKey

This commit is contained in:
Fedor Indutny 2022-03-09 12:23:21 -08:00 committed by GitHub
parent 80e445389f
commit 4a00ea46bc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 354 additions and 208 deletions

View file

@ -1140,16 +1140,16 @@ export async function mergeAccountRecord(
});
let needsProfileFetch = false;
if (accountRecord.profileKey && accountRecord.profileKey.length > 0) {
if (profileKey && profileKey.length > 0) {
needsProfileFetch = await conversation.setProfileKey(
Bytes.toBase64(accountRecord.profileKey),
Bytes.toBase64(profileKey),
{ viaStorageServiceSync: true }
);
}
if (avatarUrl) {
await conversation.setProfileAvatar(avatarUrl);
window.storage.put('avatarUrl', avatarUrl);
if (avatarUrl) {
await conversation.setProfileAvatar(avatarUrl, profileKey);
window.storage.put('avatarUrl', avatarUrl);
}
}
const { hasConflict, details: extraDetails } = doesRecordHavePendingChanges(