mirror of
https://github.com/oxen-io/session-ios.git
synced 2023-12-13 21:30:14 +01:00
use new key to verify local profile
This commit is contained in:
parent
fd482da42d
commit
ae63e399b2
1 changed files with 9 additions and 1 deletions
|
@ -1250,6 +1250,15 @@ typedef void (^ProfileManagerFailureBlock)(NSError *error);
|
|||
OWSUserProfile *userProfile =
|
||||
[OWSUserProfile getOrBuildUserProfileForRecipientId:recipientId dbConnection:self.dbConnection];
|
||||
|
||||
NSString *_Nullable localNumber = self.tsAccountManager.localNumber;
|
||||
// If we're updating the profile that corresponds to our local number,
|
||||
// make sure we're using the latest key.
|
||||
if (localNumber && [localNumber isEqualToString:recipientId]) {
|
||||
[userProfile updateWithProfileKey:self.localUserProfile.profileKey
|
||||
dbConnection:self.dbConnection
|
||||
completion:nil];
|
||||
}
|
||||
|
||||
if (!userProfile.profileKey) {
|
||||
return;
|
||||
}
|
||||
|
@ -1264,7 +1273,6 @@ typedef void (^ProfileManagerFailureBlock)(NSError *error);
|
|||
|
||||
// If we're updating the profile that corresponds to our local number,
|
||||
// update the local profile as well.
|
||||
NSString *_Nullable localNumber = self.tsAccountManager.localNumber;
|
||||
if (localNumber && [localNumber isEqualToString:recipientId]) {
|
||||
OWSUserProfile *localUserProfile = self.localUserProfile;
|
||||
OWSAssertDebug(localUserProfile);
|
||||
|
|
Loading…
Reference in a new issue