Respond to CR.

// FREEBIE
pull/1/head
Matthew Chen 8 years ago
parent 01691b7ade
commit 032ec59d1c

@ -92,9 +92,7 @@
34D1F0AA1F867BFC0066283D /* JSQMessagesCollectionViewCell+OWS.m in Sources */ = {isa = PBXBuildFile; fileRef = 34D1F0991F867BFC0066283D /* JSQMessagesCollectionViewCell+OWS.m */; };
34D1F0AB1F867BFC0066283D /* OWSContactOffersCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 34D1F09B1F867BFC0066283D /* OWSContactOffersCell.m */; };
34D1F0AC1F867BFC0066283D /* OWSExpirationTimerView.m in Sources */ = {isa = PBXBuildFile; fileRef = 34D1F09E1F867BFC0066283D /* OWSExpirationTimerView.m */; };
34D1F0AD1F867BFC0066283D /* OWSIncomingMessageCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 34D1F0A01F867BFC0066283D /* OWSIncomingMessageCell.m */; };
34D1F0AE1F867BFC0066283D /* OWSMessageCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 34D1F0A21F867BFC0066283D /* OWSMessageCell.m */; };
34D1F0AF1F867BFC0066283D /* OWSOutgoingMessageCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 34D1F0A41F867BFC0066283D /* OWSOutgoingMessageCell.m */; };
34D1F0B01F867BFC0066283D /* OWSSystemMessageCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 34D1F0A61F867BFC0066283D /* OWSSystemMessageCell.m */; };
34D1F0B11F867BFC0066283D /* OWSUnreadIndicatorCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 34D1F0A81F867BFC0066283D /* OWSUnreadIndicatorCell.m */; };
34D1F0B41F86D31D0066283D /* ConversationCollectionView.m in Sources */ = {isa = PBXBuildFile; fileRef = 34D1F0B31F86D31D0066283D /* ConversationCollectionView.m */; };
@ -157,7 +155,6 @@
452EA09E1EA7ABE00078744B /* AttachmentPointerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 452EA09D1EA7ABE00078744B /* AttachmentPointerView.swift */; };
452ECA4D1E087E7200E2F016 /* MessageFetcherJob.swift in Sources */ = {isa = PBXBuildFile; fileRef = 452ECA4C1E087E7200E2F016 /* MessageFetcherJob.swift */; };
452ECA4E1E087E7200E2F016 /* MessageFetcherJob.swift in Sources */ = {isa = PBXBuildFile; fileRef = 452ECA4C1E087E7200E2F016 /* MessageFetcherJob.swift */; };
4531C9C41DD8E6D800F08304 /* JSQMessagesCollectionViewCell+OWS.m in Sources */ = {isa = PBXBuildFile; fileRef = 4531C9C31DD8E6D800F08304 /* JSQMessagesCollectionViewCell+OWS.m */; };
45360B8D1F9521F800FA666C /* Searcher.swift in Sources */ = {isa = PBXBuildFile; fileRef = 45360B8C1F9521F800FA666C /* Searcher.swift */; };
45360B8E1F9521F800FA666C /* Searcher.swift in Sources */ = {isa = PBXBuildFile; fileRef = 45360B8C1F9521F800FA666C /* Searcher.swift */; };
45360B901F9527DA00FA666C /* SearcherTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 45360B8F1F9527DA00FA666C /* SearcherTest.swift */; };
@ -551,12 +548,8 @@
34D1F09C1F867BFC0066283D /* OWSExpirableMessageView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OWSExpirableMessageView.h; sourceTree = "<group>"; };
34D1F09D1F867BFC0066283D /* OWSExpirationTimerView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OWSExpirationTimerView.h; sourceTree = "<group>"; };
34D1F09E1F867BFC0066283D /* OWSExpirationTimerView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OWSExpirationTimerView.m; sourceTree = "<group>"; };
34D1F09F1F867BFC0066283D /* OWSIncomingMessageCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OWSIncomingMessageCell.h; sourceTree = "<group>"; };
34D1F0A01F867BFC0066283D /* OWSIncomingMessageCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OWSIncomingMessageCell.m; sourceTree = "<group>"; };
34D1F0A11F867BFC0066283D /* OWSMessageCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OWSMessageCell.h; sourceTree = "<group>"; };
34D1F0A21F867BFC0066283D /* OWSMessageCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OWSMessageCell.m; sourceTree = "<group>"; };
34D1F0A31F867BFC0066283D /* OWSOutgoingMessageCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OWSOutgoingMessageCell.h; sourceTree = "<group>"; };
34D1F0A41F867BFC0066283D /* OWSOutgoingMessageCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OWSOutgoingMessageCell.m; sourceTree = "<group>"; };
34D1F0A51F867BFC0066283D /* OWSSystemMessageCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OWSSystemMessageCell.h; sourceTree = "<group>"; };
34D1F0A61F867BFC0066283D /* OWSSystemMessageCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OWSSystemMessageCell.m; sourceTree = "<group>"; };
34D1F0A71F867BFC0066283D /* OWSUnreadIndicatorCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OWSUnreadIndicatorCell.h; sourceTree = "<group>"; };
@ -630,8 +623,6 @@
452D1EE71DCA90D100A57EC4 /* MesssagesBubblesSizeCalculatorTest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = MesssagesBubblesSizeCalculatorTest.swift; path = Models/MesssagesBubblesSizeCalculatorTest.swift; sourceTree = "<group>"; };
452EA09D1EA7ABE00078744B /* AttachmentPointerView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AttachmentPointerView.swift; sourceTree = "<group>"; };
452ECA4C1E087E7200E2F016 /* MessageFetcherJob.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = MessageFetcherJob.swift; path = Jobs/MessageFetcherJob.swift; sourceTree = "<group>"; };
4531C9C21DD8E6D800F08304 /* JSQMessagesCollectionViewCell+OWS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "JSQMessagesCollectionViewCell+OWS.h"; sourceTree = "<group>"; };
4531C9C31DD8E6D800F08304 /* JSQMessagesCollectionViewCell+OWS.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "JSQMessagesCollectionViewCell+OWS.m"; sourceTree = "<group>"; };
45360B8C1F9521F800FA666C /* Searcher.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Searcher.swift; sourceTree = "<group>"; };
45360B8F1F9527DA00FA666C /* SearcherTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearcherTest.swift; sourceTree = "<group>"; };
45387B021E36D650005D00B3 /* OWS102MoveLoggingPreferenceToUserDefaults.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OWS102MoveLoggingPreferenceToUserDefaults.h; path = Migrations/OWS102MoveLoggingPreferenceToUserDefaults.h; sourceTree = "<group>"; };
@ -1165,12 +1156,8 @@
34D1F09E1F867BFC0066283D /* OWSExpirationTimerView.m */,
34D1F0B51F87F8850066283D /* OWSGenericAttachmentView.h */,
34D1F0B61F87F8850066283D /* OWSGenericAttachmentView.m */,
34D1F09F1F867BFC0066283D /* OWSIncomingMessageCell.h */,
34D1F0A01F867BFC0066283D /* OWSIncomingMessageCell.m */,
34D1F0A11F867BFC0066283D /* OWSMessageCell.h */,
34D1F0A21F867BFC0066283D /* OWSMessageCell.m */,
34D1F0A31F867BFC0066283D /* OWSOutgoingMessageCell.h */,
34D1F0A41F867BFC0066283D /* OWSOutgoingMessageCell.m */,
34D1F0A51F867BFC0066283D /* OWSSystemMessageCell.h */,
34D1F0A61F867BFC0066283D /* OWSSystemMessageCell.m */,
34D1F0A71F867BFC0066283D /* OWSUnreadIndicatorCell.h */,
@ -2294,7 +2281,6 @@
4556FA681F54AA9500AF40DD /* DebugUIProfile.swift in Sources */,
34DFCB851E8E04B500053165 /* AddToBlockListViewController.m in Sources */,
45855F371D9498A40084F340 /* OWSContactAvatarBuilder.m in Sources */,
34D1F0AD1F867BFC0066283D /* OWSIncomingMessageCell.m in Sources */,
45A6DAD61EBBF85500893231 /* ReminderView.swift in Sources */,
45666EC61D99483D008FE134 /* OWSAvatarBuilder.m in Sources */,
45E615161E8C590B0018AD52 /* DisplayableTextFilter.swift in Sources */,
@ -2328,7 +2314,6 @@
45F659821E1BE77000444429 /* NonCallKitCallUIAdaptee.swift in Sources */,
45AE48511E0732D6004D96C2 /* TurnServerInfo.swift in Sources */,
34B3F8771E8DF1700035BE1A /* ContactsPicker.swift in Sources */,
34D1F0AF1F867BFC0066283D /* OWSOutgoingMessageCell.m in Sources */,
45C0DC1B1E68FE9000E04C47 /* UIApplication+OWS.swift in Sources */,
45638BDF1F3DDB2200128435 /* MessageSender+Promise.swift in Sources */,
34535D821E256BE9008A4747 /* UIView+OWS.m in Sources */,
@ -2440,8 +2425,6 @@
4504493A1F45EE7D002D1ADA /* NSString+OWS.m in Sources */,
45843D201D2236B30013E85A /* OWSContactsSearcher.m in Sources */,
45AE48521E0732D6004D96C2 /* TurnServerInfo.swift in Sources */,
450873C41D9D5149006B54F2 /* OWSExpirationTimerView.m in Sources */,
453D28BB1D332DB100D523F0 /* OWSMessagesBubblesSizeCalculator.m in Sources */,
45360B901F9527DA00FA666C /* SearcherTest.swift in Sources */,
B660F7561C29988E00687D6E /* PushManager.m in Sources */,
45360B911F952AA900FA666C /* MarqueeLabel.swift in Sources */,

@ -337,7 +337,7 @@ CGFloat ScaleFromIPhone5(CGFloat iPhone5Value)
constraint.active = YES;
return constraint;
} else {
return [self autoPinEdge:ALEdgeTrailing toEdge:ALEdgeLeading ofView:view withOffset:-margin];
return [self autoPinEdge:ALEdgeTrailing toEdge:ALEdgeLeading ofView:view withOffset:margin];
}
}

@ -1,16 +0,0 @@
//
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
//
#import "OWSMessageCell.h"
NS_ASSUME_NONNULL_BEGIN
// TODO: Remove this class.
@interface OWSIncomingMessageCell : OWSMessageCell
+ (NSString *)cellReuseIdentifier;
@end
NS_ASSUME_NONNULL_END

@ -1,25 +0,0 @@
//
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
//
#import "OWSIncomingMessageCell.h"
#import "ConversationViewItem.h"
#import <SignalServiceKit/TSIncomingMessage.h>
NS_ASSUME_NONNULL_BEGIN
@implementation OWSIncomingMessageCell
+ (NSString *)cellReuseIdentifier
{
return NSStringFromClass([self class]);
}
- (BOOL)isIncoming
{
return YES;
}
@end
NS_ASSUME_NONNULL_END

@ -8,6 +8,8 @@ NS_ASSUME_NONNULL_BEGIN
@interface OWSMessageCell : ConversationViewCell
+ (NSString *)cellReuseIdentifier;
@end
NS_ASSUME_NONNULL_END

@ -143,7 +143,6 @@ NS_ASSUME_NONNULL_BEGIN
self.dateHeaderLabel.hidden = YES;
self.footerLabel.hidden = YES;
[self.dateHeaderLabel autoPinEdgeToSuperviewEdge:ALEdgeTop];
[self.payloadView autoPinEdge:ALEdgeTop toEdge:ALEdgeBottom ofView:self.dateHeaderLabel];
[self.payloadView autoPinWidthToSuperview];
[self.footerView autoPinEdge:ALEdgeTop toEdge:ALEdgeBottom ofView:self.payloadView];
@ -159,6 +158,11 @@ NS_ASSUME_NONNULL_BEGIN
[self addGestureRecognizer:longPress];
}
+ (NSString *)cellReuseIdentifier
{
return NSStringFromClass([self class]);
}
- (OWSMessageCellType)cellType
{
return self.viewItem.messageCellType;
@ -196,6 +200,13 @@ NS_ASSUME_NONNULL_BEGIN
return self.viewItem.contentSize;
}
- (TSMessage *)message
{
OWSAssert([self.viewItem.interaction isKindOfClass:[TSMessage class]]);
return (TSMessage *)self.viewItem.interaction;
}
- (void)loadForDisplay:(int)contentWidth
{
OWSAssert(self.viewItem);
@ -304,6 +315,7 @@ NS_ASSUME_NONNULL_BEGIN
[self.dateHeaderLabel autoSetDimension:ALDimensionWidth toSize:contentWidth],
(self.isIncoming ? [self.dateHeaderLabel autoPinEdgeToSuperviewEdge:ALEdgeLeading]
: [self.dateHeaderLabel autoPinEdgeToSuperviewEdge:ALEdgeTrailing]),
[self.dateHeaderLabel autoPinEdgeToSuperviewEdge:ALEdgeTop],
[self.dateHeaderLabel autoSetDimension:ALDimensionHeight toSize:self.dateHeaderHeight],
];
} else {
@ -318,12 +330,11 @@ NS_ASSUME_NONNULL_BEGIN
{
BOOL showFooter = NO;
TSMessage *message = (TSMessage *)self.viewItem.interaction;
BOOL hasExpirationTimer = message.shouldStartExpireTimer;
BOOL hasExpirationTimer = self.message.shouldStartExpireTimer;
if (hasExpirationTimer) {
showFooter = YES;
} else if (!self.isIncoming) {
} else if (self.isOutgoing) {
showFooter = !self.viewItem.shouldHideRecipientStatus;
} else if (self.viewItem.isGroupThread) {
showFooter = YES;
@ -341,10 +352,10 @@ NS_ASSUME_NONNULL_BEGIN
OWSAssert(self.viewItem.interaction.interactionType == OWSInteractionType_IncomingMessage
|| self.viewItem.interaction.interactionType == OWSInteractionType_OutgoingMessage);
TSMessage *message = (TSMessage *)self.viewItem.interaction;
TSMessage *message = self.message;
BOOL hasExpirationTimer = message.shouldStartExpireTimer;
NSAttributedString *attributedText = nil;
if (!self.isIncoming) {
if (self.isOutgoing) {
if (!self.viewItem.shouldHideRecipientStatus || hasExpirationTimer) {
TSOutgoingMessage *outgoingMessage = (TSOutgoingMessage *)message;
NSString *statusMessage =
@ -365,8 +376,7 @@ NS_ASSUME_NONNULL_BEGIN
return;
}
if (hasExpirationTimer)
{
if (hasExpirationTimer) {
uint64_t expirationTimestamp = message.expiresAt;
uint32_t expiresInSeconds = message.expiresInSeconds;
self.expirationTimerView = [[OWSExpirationTimerView alloc] initWithExpiration:expirationTimestamp
@ -587,7 +597,7 @@ NS_ASSUME_NONNULL_BEGIN
OWSAssert(attachmentView);
OWSAssert(attachmentStateCallback);
if (!self.isIncoming) {
if (self.isOutgoing) {
self.attachmentUploadView = [[AttachmentUploadView alloc] initWithAttachment:self.attachmentStream
superview:attachmentView
attachmentStateCallback:attachmentStateCallback];
@ -599,7 +609,7 @@ NS_ASSUME_NONNULL_BEGIN
OWSAssert(view);
OWSAssert(view.superview == self.payloadView);
self.payloadView.isOutgoing = !self.isIncoming;
self.payloadView.isOutgoing = self.isOutgoing;
self.payloadView.maskedSubview = view;
[self.payloadView updateMask];
}
@ -715,7 +725,12 @@ NS_ASSUME_NONNULL_BEGIN
- (BOOL)isIncoming
{
return YES;
return self.viewItem.interaction.interactionType == OWSInteractionType_IncomingMessage;
}
- (BOOL)isOutgoing
{
return self.viewItem.interaction.interactionType == OWSInteractionType_OutgoingMessage;
}
- (CGFloat)textLeadingMargin
@ -837,15 +852,16 @@ NS_ASSUME_NONNULL_BEGIN
#pragma mark - Notifications
- (void)setIsCellVisible:(BOOL)isCellVisible {
if (self.isCellVisible == isCellVisible) {
return;
}
BOOL didChange = self.isCellVisible != isCellVisible;
[super setIsCellVisible:isCellVisible];
if (!didChange) {
return;
}
if (isCellVisible) {
TSMessage *message = (TSMessage *)self.viewItem.interaction;
if (message.shouldStartExpireTimer) {
if (self.message.shouldStartExpireTimer) {
[self.expirationTimerView ensureAnimations];
} else {
[self.expirationTimerView clearAnimations];
@ -985,7 +1001,7 @@ NS_ASSUME_NONNULL_BEGIN
{
OWSAssert([self.viewItem.interaction isKindOfClass:[TSMessage class]]);
[self.delegate showMetadataViewForMessage:(TSMessage *)self.viewItem.interaction];
[self.delegate showMetadataViewForMessage:self.message];
}
- (BOOL)canBecomeFirstResponder

@ -1,16 +0,0 @@
//
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
//
#import "OWSMessageCell.h"
NS_ASSUME_NONNULL_BEGIN
// TODO: Remove this class.
@interface OWSOutgoingMessageCell : OWSMessageCell
+ (NSString *)cellReuseIdentifier;
@end
NS_ASSUME_NONNULL_END

@ -1,26 +0,0 @@
//
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
//
#import "OWSOutgoingMessageCell.h"
#import "ConversationViewItem.h"
#import "UIView+OWS.h"
#import <SignalServiceKit/TSOutgoingMessage.h>
NS_ASSUME_NONNULL_BEGIN
@implementation OWSOutgoingMessageCell
+ (NSString *)cellReuseIdentifier
{
return NSStringFromClass([self class]);
}
- (BOOL)isIncoming
{
return NO;
}
@end
NS_ASSUME_NONNULL_END

@ -28,8 +28,7 @@
#import "OWSConversationSettingsViewController.h"
#import "OWSConversationSettingsViewDelegate.h"
#import "OWSDisappearingMessagesJob.h"
#import "OWSIncomingMessageCell.h"
#import "OWSOutgoingMessageCell.h"
#import "OWSMessageCell.h"
#import "OWSSystemMessageCell.h"
#import "OWSUnreadIndicatorCell.h"
#import "Signal-Swift.h"
@ -494,10 +493,8 @@ typedef NS_ENUM(NSInteger, MessagesRangeSizeMode) {
forCellWithReuseIdentifier:[OWSUnreadIndicatorCell cellReuseIdentifier]];
[self.collectionView registerClass:[OWSContactOffersCell class]
forCellWithReuseIdentifier:[OWSContactOffersCell cellReuseIdentifier]];
[self.collectionView registerClass:[OWSOutgoingMessageCell class]
forCellWithReuseIdentifier:[OWSOutgoingMessageCell cellReuseIdentifier]];
[self.collectionView registerClass:[OWSIncomingMessageCell class]
forCellWithReuseIdentifier:[OWSIncomingMessageCell cellReuseIdentifier]];
[self.collectionView registerClass:[OWSMessageCell class]
forCellWithReuseIdentifier:[OWSMessageCell cellReuseIdentifier]];
}
- (void)applicationWillEnterForeground:(NSNotification *)notification
@ -3846,7 +3843,7 @@ typedef NS_ENUM(NSInteger, MessagesRangeSizeMode) {
ConversationViewItem *_Nullable viewItem = self.viewItemMap[interaction.uniqueId];
if (viewItem) {
viewItem.lastRow = viewItem.row;
viewItem.previousRow = viewItem.row;
} else {
viewItem = [[ConversationViewItem alloc] initWithTSInteraction:interaction isGroupThread:isGroupThread];
}
@ -3901,8 +3898,8 @@ typedef NS_ENUM(NSInteger, MessagesRangeSizeMode) {
// If this is an existing view item and it has changed size,
// note that so that we can reload this cell while doing
// incremental updates.
if (viewItem.shouldShowDate != shouldShowDate && viewItem.lastRow != NSNotFound) {
[rowsThatChangedSize addObject:@(viewItem.lastRow)];
if (viewItem.shouldShowDate != shouldShowDate && viewItem.previousRow != NSNotFound) {
[rowsThatChangedSize addObject:@(viewItem.previousRow)];
}
viewItem.shouldShowDate = shouldShowDate;
@ -3929,8 +3926,8 @@ typedef NS_ENUM(NSInteger, MessagesRangeSizeMode) {
// If this is an existing view item and it has changed size,
// note that so that we can reload this cell while doing
// incremental updates.
if (viewItem.shouldHideRecipientStatus != shouldHideRecipientStatus && viewItem.lastRow != NSNotFound) {
[rowsThatChangedSize addObject:@(viewItem.lastRow)];
if (viewItem.shouldHideRecipientStatus != shouldHideRecipientStatus && viewItem.previousRow != NSNotFound) {
[rowsThatChangedSize addObject:@(viewItem.previousRow)];
}
viewItem.shouldHideRecipientStatus = shouldHideRecipientStatus;
}

@ -45,7 +45,9 @@ NSString *NSStringForOWSMessageCellType(OWSMessageCellType cellType);
@property (nonatomic) BOOL shouldHideRecipientStatus;
@property (nonatomic) NSInteger row;
@property (nonatomic) NSInteger lastRow;
// During updates, we sometimes need the previous row index
// (before this update) of this item.
@property (nonatomic) NSInteger previousRow;
//@property (nonatomic, weak) ConversationViewCell *lastCell;

@ -5,8 +5,7 @@
#import "ConversationViewItem.h"
#import "OWSAudioMessageView.h"
#import "OWSContactOffersCell.h"
#import "OWSIncomingMessageCell.h"
#import "OWSOutgoingMessageCell.h"
#import "OWSMessageCell.h"
#import "OWSSystemMessageCell.h"
#import "OWSUnreadIndicatorCell.h"
#import "Signal-Swift.h"
@ -72,7 +71,7 @@ NSString *NSStringForOWSMessageCellType(OWSMessageCellType cellType)
_interaction = interaction;
_isGroupThread = isGroupThread;
self.row = NSNotFound;
self.lastRow = NSNotFound;
self.previousRow = NSNotFound;
return self;
}
@ -176,10 +175,8 @@ NSString *NSStringForOWSMessageCellType(OWSMessageCellType cellType)
OWSFail(@"%@ Unknown interaction type.", self.tag);
return nil;
case OWSInteractionType_IncomingMessage:
measurementCell = [OWSIncomingMessageCell new];
break;
case OWSInteractionType_OutgoingMessage:
measurementCell = [OWSOutgoingMessageCell new];
measurementCell = [OWSMessageCell new];
break;
case OWSInteractionType_Error:
case OWSInteractionType_Info:
@ -214,10 +211,8 @@ NSString *NSStringForOWSMessageCellType(OWSMessageCellType cellType)
OWSFail(@"%@ Unknown interaction type.", self.tag);
return nil;
case OWSInteractionType_IncomingMessage:
return [collectionView dequeueReusableCellWithReuseIdentifier:[OWSIncomingMessageCell cellReuseIdentifier]
forIndexPath:indexPath];
case OWSInteractionType_OutgoingMessage:
return [collectionView dequeueReusableCellWithReuseIdentifier:[OWSOutgoingMessageCell cellReuseIdentifier]
return [collectionView dequeueReusableCellWithReuseIdentifier:[OWSMessageCell cellReuseIdentifier]
forIndexPath:indexPath];
case OWSInteractionType_Error:
case OWSInteractionType_Info:

@ -193,7 +193,7 @@ class MessageMetadataViewController: OWSViewController {
if groupRows.count < 1 {
if isGroupThread {
groupRows.append(valueRow(name: MessageRecipientStatusName(recipientStatusGroup),
groupRows.append(valueRow(name: string(for: recipientStatusGroup),
value: ""))
}
@ -532,8 +532,8 @@ class MessageMetadataViewController: OWSViewController {
updateContent()
}
private func MessageRecipientStatusName(_ value: MessageRecipientStatus) -> String {
switch value {
private func string(for messageRecipientStatus: MessageRecipientStatus) -> String {
switch messageRecipientStatus {
case .uploading:
return NSLocalizedString("MESSAGE_METADATA_VIEW_MESSAGE_STATUS_UPLOADING",
comment: "Status label for messages which are uploading.")

Loading…
Cancel
Save