Clean up ahead of PR.

pull/1/head
Matthew Chen 8 years ago
parent c648812cf7
commit ca4757b8d1

@ -1107,14 +1107,15 @@ NS_ASSUME_NONNULL_BEGIN
OWSMessageTextView *bodyTextView = [self configureBodyTextView]; OWSMessageTextView *bodyTextView = [self configureBodyTextView];
CGSize textSize = CGSizeCeil([bodyTextView sizeThatFits:CGSizeMake(maxTextWidth, CGFLOAT_MAX)]); CGSize textSize = CGSizeCeil([bodyTextView sizeThatFits:CGSizeMake(maxTextWidth, CGFLOAT_MAX)]);
CGSize textViewSize = textSize; textSize.width = MIN(textSize.width, maxTextWidth);
CGSize result = textSize;
if (includeMargins) { if (includeMargins) {
textViewSize.width += leftMargin + rightMargin; result.width += leftMargin + rightMargin;
textViewSize.height += self.textTopMargin + self.textBottomMargin; result.height += self.textTopMargin + self.textBottomMargin;
} }
return CGSizeCeil(textViewSize); return CGSizeCeil(result);
} }
- (CGSize)bodyMediaSizeForContentWidth:(int)contentWidth - (CGSize)bodyMediaSizeForContentWidth:(int)contentWidth

@ -75,7 +75,7 @@ NS_ASSUME_NONNULL_BEGIN
&& ![OWSMimeTypeOversizeTextMessage isEqualToString:self.quotedMessage.contentType]); && ![OWSMimeTypeOversizeTextMessage isEqualToString:self.quotedMessage.contentType]);
} }
- (BOOL)hasQuotedAttachmentThumbnail - (BOOL)hasQuotedAttachmentThumbnailImage
{ {
return (self.quotedMessage.contentType.length > 0 return (self.quotedMessage.contentType.length > 0
&& ![OWSMimeTypeOversizeTextMessage isEqualToString:self.quotedMessage.contentType] && && ![OWSMimeTypeOversizeTextMessage isEqualToString:self.quotedMessage.contentType] &&
@ -206,7 +206,7 @@ NS_ASSUME_NONNULL_BEGIN
- (nullable UIImage *)tryToLoadThumbnailImage - (nullable UIImage *)tryToLoadThumbnailImage
{ {
if (!self.hasQuotedAttachmentThumbnail) { if (!self.hasQuotedAttachmentThumbnailImage) {
return nil; return nil;
} }
if (!self.quotedMessage.thumbnailData) { if (!self.quotedMessage.thumbnailData) {

@ -588,7 +588,7 @@ NS_ASSUME_NONNULL_BEGIN
if (!error) { if (!error) {
return (CGFloat)[audioPlayer duration]; return (CGFloat)[audioPlayer duration];
} else { } else {
OWSFail(@"Could not find audio duration: %@", self.mediaURL); DDLogError(@"Could not find audio duration: %@", self.mediaURL);
return 0; return 0;
} }
} }

Loading…
Cancel
Save