Respond to CR.
This commit is contained in:
parent
6711ed1cf3
commit
e48a1e0816
|
@ -103,7 +103,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||||
}
|
}
|
||||||
self.timestampLabel.textColor = textColor;
|
self.timestampLabel.textColor = textColor;
|
||||||
|
|
||||||
if ([self shouldShowDisappearingTimer:viewItem]) {
|
if (viewItem.isExpiringMessage) {
|
||||||
TSMessage *message = (TSMessage *)viewItem.interaction;
|
TSMessage *message = (TSMessage *)viewItem.interaction;
|
||||||
uint64_t expirationTimestamp = message.expiresAt;
|
uint64_t expirationTimestamp = message.expiresAt;
|
||||||
uint32_t expiresInSeconds = message.expiresInSeconds;
|
uint32_t expiresInSeconds = message.expiresInSeconds;
|
||||||
|
@ -185,19 +185,6 @@ NS_ASSUME_NONNULL_BEGIN
|
||||||
return messageStatus == MessageReceiptStatusFailed;
|
return messageStatus == MessageReceiptStatusFailed;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (BOOL)shouldShowDisappearingTimer:(ConversationViewItem *)viewItem
|
|
||||||
{
|
|
||||||
OWSAssert(viewItem);
|
|
||||||
|
|
||||||
if (viewItem.interaction.interactionType != OWSInteractionType_OutgoingMessage
|
|
||||||
&& viewItem.interaction.interactionType != OWSInteractionType_IncomingMessage) {
|
|
||||||
return NO;
|
|
||||||
}
|
|
||||||
|
|
||||||
TSMessage *message = (TSMessage *)viewItem.interaction;
|
|
||||||
return message.isExpiringMessage;
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)configureLabelsWithConversationViewItem:(ConversationViewItem *)viewItem
|
- (void)configureLabelsWithConversationViewItem:(ConversationViewItem *)viewItem
|
||||||
{
|
{
|
||||||
OWSAssert(viewItem);
|
OWSAssert(viewItem);
|
||||||
|
@ -257,7 +244,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ([self shouldShowDisappearingTimer:viewItem]) {
|
if (viewItem.isExpiringMessage) {
|
||||||
result.width += ([OWSMessageTimerView measureSize].width + self.hSpacing);
|
result.width += ([OWSMessageTimerView measureSize].width + self.hSpacing);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -54,6 +54,8 @@ NSString *NSStringForOWSMessageCellType(OWSMessageCellType cellType);
|
||||||
@property (nonatomic, readonly) BOOL hasQuotedAttachment;
|
@property (nonatomic, readonly) BOOL hasQuotedAttachment;
|
||||||
@property (nonatomic, readonly) BOOL hasQuotedText;
|
@property (nonatomic, readonly) BOOL hasQuotedText;
|
||||||
|
|
||||||
|
@property (nonatomic, readonly) BOOL isExpiringMessage;
|
||||||
|
|
||||||
@property (nonatomic) BOOL shouldShowDate;
|
@property (nonatomic) BOOL shouldShowDate;
|
||||||
@property (nonatomic) BOOL shouldShowSenderAvatar;
|
@property (nonatomic) BOOL shouldShowSenderAvatar;
|
||||||
@property (nonatomic, nullable) NSAttributedString *senderName;
|
@property (nonatomic, nullable) NSAttributedString *senderName;
|
||||||
|
|
|
@ -138,6 +138,17 @@ NSString *NSStringForOWSMessageCellType(OWSMessageCellType cellType)
|
||||||
return self.hasQuotedAttachment || self.hasQuotedText;
|
return self.hasQuotedAttachment || self.hasQuotedText;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (BOOL)isExpiringMessage
|
||||||
|
{
|
||||||
|
if (self.interaction.interactionType != OWSInteractionType_OutgoingMessage
|
||||||
|
&& self.interaction.interactionType != OWSInteractionType_IncomingMessage) {
|
||||||
|
return NO;
|
||||||
|
}
|
||||||
|
|
||||||
|
TSMessage *message = (TSMessage *)self.interaction;
|
||||||
|
return message.isExpiringMessage;
|
||||||
|
}
|
||||||
|
|
||||||
- (void)setShouldShowDate:(BOOL)shouldShowDate
|
- (void)setShouldShowDate:(BOOL)shouldShowDate
|
||||||
{
|
{
|
||||||
if (_shouldShowDate == shouldShowDate) {
|
if (_shouldShowDate == shouldShowDate) {
|
||||||
|
|
|
@ -45,7 +45,6 @@ NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
- (void)setQuotedMessageThumbnailAttachmentStream:(TSAttachmentStream *)attachmentStream;
|
- (void)setQuotedMessageThumbnailAttachmentStream:(TSAttachmentStream *)attachmentStream;
|
||||||
|
|
||||||
- (BOOL)shouldStartExpireTimer;
|
|
||||||
- (BOOL)shouldStartExpireTimerWithTransaction:(YapDatabaseReadTransaction *)transaction;
|
- (BOOL)shouldStartExpireTimerWithTransaction:(YapDatabaseReadTransaction *)transaction;
|
||||||
|
|
||||||
#pragma mark - Update With... Methods
|
#pragma mark - Update With... Methods
|
||||||
|
|
|
@ -182,15 +182,6 @@ static const NSUInteger OWSMessageSchemaVersion = 4;
|
||||||
[self updateExpiresAt];
|
[self updateExpiresAt];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (BOOL)shouldStartExpireTimer
|
|
||||||
{
|
|
||||||
__block BOOL result;
|
|
||||||
[self.dbReadConnection readWithBlock:^(YapDatabaseReadTransaction *_Nonnull transaction) {
|
|
||||||
result = [self shouldStartExpireTimerWithTransaction:transaction];
|
|
||||||
}];
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
- (BOOL)shouldStartExpireTimerWithTransaction:(YapDatabaseReadTransaction *)transaction
|
- (BOOL)shouldStartExpireTimerWithTransaction:(YapDatabaseReadTransaction *)transaction
|
||||||
{
|
{
|
||||||
return self.isExpiringMessage;
|
return self.isExpiringMessage;
|
||||||
|
|
Loading…
Reference in New Issue