|
|
@ -668,12 +668,8 @@ static const NSInteger kProfileKeyLength = 16;
|
|
|
|
avatarDigest = nil;
|
|
|
|
avatarDigest = nil;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
BOOL isProfileNameSame = [self isNullableStringEqual:userProfile.profileName toString:profileName];
|
|
|
|
|
|
|
|
BOOL isAvatarSame = ([self isNullableStringEqual:userProfile.avatarUrl toString:avatarUrl] &&
|
|
|
|
BOOL isAvatarSame = ([self isNullableStringEqual:userProfile.avatarUrl toString:avatarUrl] &&
|
|
|
|
[self isNullableDataEqual:userProfile.avatarDigest toData:avatarDigest]);
|
|
|
|
[self isNullableDataEqual:userProfile.avatarDigest toData:avatarDigest]);
|
|
|
|
if (isProfileNameSame && isAvatarSame) {
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dispatch_async(dispatch_get_main_queue(), ^{
|
|
|
|
dispatch_async(dispatch_get_main_queue(), ^{
|
|
|
|
userProfile.profileName = profileName;
|
|
|
|
userProfile.profileName = profileName;
|
|
|
@ -683,12 +679,14 @@ static const NSInteger kProfileKeyLength = 16;
|
|
|
|
if (!isAvatarSame) {
|
|
|
|
if (!isAvatarSame) {
|
|
|
|
// Evacuate avatar image cache.
|
|
|
|
// Evacuate avatar image cache.
|
|
|
|
[self.otherUsersProfileAvatarImageCache removeObjectForKey:recipientId];
|
|
|
|
[self.otherUsersProfileAvatarImageCache removeObjectForKey:recipientId];
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (avatarUrl) {
|
|
|
|
if (avatarUrl) {
|
|
|
|
[self downloadProfileAvatarWithUrl:avatarUrl recipientId:recipientId];
|
|
|
|
[self downloadProfileAvatarWithUrl:avatarUrl recipientId:recipientId];
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
userProfile.lastUpdateDate = [NSDate new];
|
|
|
|
|
|
|
|
|
|
|
|
[self saveUserProfile:userProfile];
|
|
|
|
[self saveUserProfile:userProfile];
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|