getProfile: Only clear profile name if profile is missing it
This commit is contained in:
parent
efe7195bb6
commit
0d87bbb5eb
2 changed files with 11 additions and 11 deletions
|
@ -771,10 +771,6 @@ async function doGetProfile(
|
||||||
Errors.toLogFormat(error)
|
Errors.toLogFormat(error)
|
||||||
);
|
);
|
||||||
isSuccessfullyDecrypted = false;
|
isSuccessfullyDecrypted = false;
|
||||||
c.set({
|
|
||||||
profileName: undefined,
|
|
||||||
profileFamilyName: undefined,
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -1182,20 +1182,24 @@ export async function mergeContactRecord(
|
||||||
remoteName &&
|
remoteName &&
|
||||||
(localName !== remoteName || localFamilyName !== remoteFamilyName)
|
(localName !== remoteName || localFamilyName !== remoteFamilyName)
|
||||||
) {
|
) {
|
||||||
// Local name doesn't match remote name, fetch profile
|
log.info(
|
||||||
|
`mergeContactRecord: ${conversation.idForLogging()} name doesn't match remote name; overwriting`
|
||||||
|
);
|
||||||
|
details.push('updated profile name');
|
||||||
|
conversation.set({
|
||||||
|
profileName: remoteName,
|
||||||
|
profileFamilyName: remoteFamilyName,
|
||||||
|
});
|
||||||
if (localName) {
|
if (localName) {
|
||||||
|
log.info(
|
||||||
|
`mergeContactRecord: ${conversation.idForLogging()} name doesn't match remote name; also fetching profile`
|
||||||
|
);
|
||||||
drop(
|
drop(
|
||||||
conversation.getProfiles().catch(() => {
|
conversation.getProfiles().catch(() => {
|
||||||
/* nothing to do here; logging already happened */
|
/* nothing to do here; logging already happened */
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
details.push('refreshing profile');
|
details.push('refreshing profile');
|
||||||
} else {
|
|
||||||
conversation.set({
|
|
||||||
profileName: remoteName,
|
|
||||||
profileFamilyName: remoteFamilyName,
|
|
||||||
});
|
|
||||||
details.push('updated profile name');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
conversation.set({
|
conversation.set({
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue