From 49e65ba1b1b2aab97832f1affae5a23b701fba66 Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Thu, 3 Aug 2017 13:43:03 -0400 Subject: [PATCH] Update user profile update date on successful update. // FREEBIE --- Signal/src/Profiles/OWSProfileManager.m | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/Signal/src/Profiles/OWSProfileManager.m b/Signal/src/Profiles/OWSProfileManager.m index 14a0083d1..a86a4b0fc 100644 --- a/Signal/src/Profiles/OWSProfileManager.m +++ b/Signal/src/Profiles/OWSProfileManager.m @@ -668,12 +668,8 @@ static const NSInteger kProfileKeyLength = 16; avatarDigest = nil; } - BOOL isProfileNameSame = [self isNullableStringEqual:userProfile.profileName toString:profileName]; BOOL isAvatarSame = ([self isNullableStringEqual:userProfile.avatarUrl toString:avatarUrl] && [self isNullableDataEqual:userProfile.avatarDigest toData:avatarDigest]); - if (isProfileNameSame && isAvatarSame) { - return; - } dispatch_async(dispatch_get_main_queue(), ^{ userProfile.profileName = profileName; @@ -683,12 +679,14 @@ static const NSInteger kProfileKeyLength = 16; if (!isAvatarSame) { // Evacuate avatar image cache. [self.otherUsersProfileAvatarImageCache removeObjectForKey:recipientId]; - } - if (avatarUrl) { - [self downloadProfileAvatarWithUrl:avatarUrl recipientId:recipientId]; + if (avatarUrl) { + [self downloadProfileAvatarWithUrl:avatarUrl recipientId:recipientId]; + } } + userProfile.lastUpdateDate = [NSDate new]; + [self saveUserProfile:userProfile]; }); }