From 0dfdb8ce880b1519b4e451563de5f04fb353229f Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Fri, 6 Apr 2018 13:53:11 -0400 Subject: [PATCH] Elaborate quoted reply variations to include replies with attachments. --- .../Cells/OWSMessageBubbleView.m | 25 +++++-------------- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageBubbleView.m b/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageBubbleView.m index f012086b8..0779cdcfe 100644 --- a/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageBubbleView.m +++ b/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageBubbleView.m @@ -266,15 +266,8 @@ NS_ASSUME_NONNULL_BEGIN [quotedMessageView autoPinLeadingToSuperviewMarginWithInset:bubbleLeadingMargin], [quotedMessageView autoPinTrailingToSuperviewMarginWithInset:bubbleTrailingMargin], ]]; - // We need constraints to control the vertical sizing of bubble content views, but we use - // lower priority so that when a message only contains media it uses the exact bounds of - // the message view. - [NSLayoutConstraint - autoSetPriority:UILayoutPriorityDefaultLow - forConstraints:^{ - [self.viewConstraints addObject:[quotedMessageView autoSetDimension:ALDimensionHeight - toSize:quotedMessageContentSize.height]]; - }]; + [self.viewConstraints + addObject:[quotedMessageView autoSetDimension:ALDimensionHeight toSize:quotedMessageContentSize.height]]; if (lastSubview) { [self.viewConstraints @@ -344,7 +337,7 @@ NS_ASSUME_NONNULL_BEGIN [bodyMediaView autoPinLeadingToSuperviewMarginWithInset:0], [bodyMediaView autoPinTrailingToSuperviewMarginWithInset:0], ]]; - // We need constraints to control the vertical sizing of bubble content views, but we use + // We need constraints to control the vertical sizing of the media view, but we use // lower priority so that when a message only contains media it uses the exact bounds of // the message view. [NSLayoutConstraint @@ -391,15 +384,9 @@ NS_ASSUME_NONNULL_BEGIN [bodyTextView autoPinLeadingToSuperviewMarginWithInset:self.textLeadingMargin], [bodyTextView autoPinTrailingToSuperviewMarginWithInset:self.textTrailingMargin], ]]; - // We need constraints to control the vertical sizing of bubble content views, but we use - // lower priority so that when a message only contains media it uses the exact bounds of - // the message view. - [NSLayoutConstraint - autoSetPriority:UILayoutPriorityDefaultLow - forConstraints:^{ - [self.viewConstraints - addObject:[bodyTextView autoSetDimension:ALDimensionHeight toSize:bodyTextContentSize.height]]; - }]; + [self.viewConstraints + addObject:[bodyTextView autoSetDimension:ALDimensionHeight toSize:bodyTextContentSize.height]]; + if (lastSubview) { [self.viewConstraints addObject:[bodyTextView autoPinEdge:ALEdgeTop toEdge:ALEdgeBottom