Fix profile name being cleared when setting profile picture.

pull/70/head
Mikunj 5 years ago
parent 9435c6dd1d
commit abc6e20207

@ -83,8 +83,6 @@ extern const NSUInteger kOWSProfileManager_MaxAvatarDiameter;
profileNameEncrypted:(nullable NSData *)profileNameEncrypted profileNameEncrypted:(nullable NSData *)profileNameEncrypted
avatarUrlPath:(nullable NSString *)avatarUrlPath; avatarUrlPath:(nullable NSString *)avatarUrlPath;
- (void)updateProfileForContactWithID:(NSString *)contactID displayName:(NSString *)displayName with:(YapDatabaseReadWriteTransaction *)transaction;
#pragma mark - User Interface #pragma mark - User Interface
- (void)presentAddThreadToProfileWhitelist:(TSThread *)thread - (void)presentAddThreadToProfileWhitelist:(TSThread *)thread

@ -975,7 +975,7 @@ typedef void (^ProfileManagerFailureBlock)(NSError *error);
dispatch_async(dispatch_get_main_queue(), ^{ dispatch_async(dispatch_get_main_queue(), ^{
[self.udManager setUnidentifiedAccessMode:UnidentifiedAccessModeUnknown [self.udManager setUnidentifiedAccessMode:UnidentifiedAccessModeUnknown
recipientId:recipientId]; recipientId:recipientId];
[userProfile updateWithProfileName:userProfile.profileName avatarUrlPath:avatarURL dbConnection:self.dbConnection completion:^{ [userProfile updateWithAvatarUrlPath:avatarURL avatarFileName:nil dbConnection:self.dbConnection completion:^{
[self downloadAvatarForUserProfile:userProfile]; [self downloadAvatarForUserProfile:userProfile];
}]; }];
// [self fetchProfileForRecipientId:recipientId]; // [self fetchProfileForRecipientId:recipientId];

@ -351,7 +351,7 @@ NSString *const kLocalProfileUniqueId = @"kLocalProfileUniqueId";
{ {
[self applyChanges:^(OWSUserProfile *userProfile) { [self applyChanges:^(OWSUserProfile *userProfile) {
[userProfile setProfileKey:profileKey]; [userProfile setProfileKey:profileKey];
[userProfile setProfileName:nil]; // [userProfile setProfileName:nil]; - Loki disabled until we include profile name inside the encrypted profile from the url
// Always setAvatarUrlPath: before you setAvatarFileName: since // Always setAvatarUrlPath: before you setAvatarFileName: since
// setAvatarUrlPath: may clear the avatar filename. // setAvatarUrlPath: may clear the avatar filename.
[userProfile setAvatarUrlPath:nil]; [userProfile setAvatarUrlPath:nil];

Loading…
Cancel
Save