Don't update our own profile key from group state

This commit is contained in:
Fedor Indutny 2022-04-14 15:26:47 -07:00 committed by GitHub
parent 908ecda64f
commit 6856e246e2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View file

@ -2932,6 +2932,7 @@ async function updateGroup(
);
if (
!isMe(contact.attributes) &&
member.profileKey &&
member.profileKey.length > 0 &&
contact.get('profileKey') !== member.profileKey

View file

@ -131,10 +131,12 @@ async function doGetProfile(c: ConversationModel): Promise<void> {
throw error;
}
if (error.code === 401 || error.code === 403) {
if (!isMe(c.attributes)) {
await c.setProfileKey(undefined);
if (isMe(c.attributes)) {
throw error;
}
await c.setProfileKey(undefined);
// Retry fetch using last known profileKeyVersion or fetch
// unversioned profile.
return doGetProfile(c);