better var name per code review

// FREEBIE
pull/1/head
Michael Kirk 8 years ago
parent fd02644ca7
commit 2c3e99c372

@ -9,7 +9,7 @@ NS_ASSUME_NONNULL_BEGIN
extern NSString *const kNSNotificationName_LocalProfileDidChange; extern NSString *const kNSNotificationName_LocalProfileDidChange;
extern NSString *const kNSNotificationName_OtherUsersProfileDidChange; extern NSString *const kNSNotificationName_OtherUsersProfileDidChange;
extern const NSUInteger kOWSProfileManager_MaxAvatarWidth; extern const NSUInteger kOWSProfileManager_MaxAvatarDiameter;
@class TSThread; @class TSThread;
@class OWSAES128Key; @class OWSAES128Key;

@ -94,7 +94,7 @@ NSString *const kOWSProfileManager_GroupWhitelistCollection = @"kOWSProfileManag
/// The max bytes for a user's profile name, encoded in UTF8. /// The max bytes for a user's profile name, encoded in UTF8.
/// Before encrypting and submitting we NULL pad the name data to this length. /// Before encrypting and submitting we NULL pad the name data to this length.
static const NSUInteger kOWSProfileManager_NameDataLength = 26; static const NSUInteger kOWSProfileManager_NameDataLength = 26;
const NSUInteger kOWSProfileManager_MaxAvatarWidth = 640; const NSUInteger kOWSProfileManager_MaxAvatarDiameter = 640;
@interface OWSProfileManager () @interface OWSProfileManager ()
@ -403,13 +403,13 @@ const NSUInteger kOWSProfileManager_MaxAvatarWidth = 640;
{ {
NSUInteger kMaxAvatarBytes = 5 * 1000 * 1000; NSUInteger kMaxAvatarBytes = 5 * 1000 * 1000;
if (image.size.width != kOWSProfileManager_MaxAvatarWidth if (image.size.width != kOWSProfileManager_MaxAvatarDiameter
|| image.size.height != kOWSProfileManager_MaxAvatarWidth) { || image.size.height != kOWSProfileManager_MaxAvatarDiameter) {
// To help ensure the user is being shown the same cropping of their avatar as // To help ensure the user is being shown the same cropping of their avatar as
// everyone else will see, we want to be sure that the image was resized before this point. // everyone else will see, we want to be sure that the image was resized before this point.
OWSFail(@"Avatar image should have been resized before trying to upload"); OWSFail(@"Avatar image should have been resized before trying to upload");
image = [image resizedImageToFillPixelSize:CGSizeMake(kOWSProfileManager_MaxAvatarWidth, image = [image resizedImageToFillPixelSize:CGSizeMake(kOWSProfileManager_MaxAvatarDiameter,
kOWSProfileManager_MaxAvatarWidth)]; kOWSProfileManager_MaxAvatarDiameter)];
} }
NSData *_Nullable data; NSData *_Nullable data;

@ -280,8 +280,8 @@ NS_ASSUME_NONNULL_BEGIN
{ {
OWSAssert(image); OWSAssert(image);
self.avatar = [image self.avatar = [image resizedImageToFillPixelSize:CGSizeMake(kOWSProfileManager_MaxAvatarDiameter,
resizedImageToFillPixelSize:CGSizeMake(kOWSProfileManager_MaxAvatarWidth, kOWSProfileManager_MaxAvatarWidth)]; kOWSProfileManager_MaxAvatarDiameter)];
} }
- (UIViewController *)fromViewController - (UIViewController *)fromViewController

Loading…
Cancel
Save