diff --git a/Session/Conversations/Message Cells/InfoMessageCell.swift b/Session/Conversations/Message Cells/InfoMessageCell.swift index 4d5ce131c..77f3ca632 100644 --- a/Session/Conversations/Message Cells/InfoMessageCell.swift +++ b/Session/Conversations/Message Cells/InfoMessageCell.swift @@ -101,6 +101,15 @@ final class InfoMessageCell: MessageCell { iconImageView.themeTintColor = .textSecondary } + self.label.text = cellViewModel.body + self.label.themeTextColor = (cellViewModel.variant == .infoClosedGroupCurrentUserErrorLeaving) ? .danger : .textSecondary + + let shouldShowIcon: Bool = (icon != nil) || ((cellViewModel.expiresInSeconds ?? 0) > 0) + + iconContainerViewWidthConstraint.constant = shouldShowIcon ? InfoMessageCell.iconSize : 0 + iconContainerViewHeightConstraint.constant = shouldShowIcon ? InfoMessageCell.iconSize : 0 + + guard shouldShowIcon else { return } // Timer if let expiresStartedAtMs: Double = cellViewModel.expiresStartedAtMs, @@ -120,14 +129,6 @@ final class InfoMessageCell: MessageCell { timerView.isHidden = true iconImageView.isHidden = false } - - let shouldShowIcon: Bool = (icon != nil) || ((cellViewModel.expiresInSeconds ?? 0) > 0) - - iconContainerViewWidthConstraint.constant = shouldShowIcon ? InfoMessageCell.iconSize : 0 - iconContainerViewHeightConstraint.constant = shouldShowIcon ? InfoMessageCell.iconSize : 0 - - self.label.text = cellViewModel.body - self.label.themeTextColor = (cellViewModel.variant == .infoClosedGroupCurrentUserErrorLeaving) ? .danger : .textSecondary } override func dynamicUpdate(with cellViewModel: MessageViewModel, playbackInfo: ConversationViewModel.PlaybackInfo?) { diff --git a/SessionMessagingKit/Database/Models/Interaction.swift b/SessionMessagingKit/Database/Models/Interaction.swift index 292b88acd..3bfb0381a 100644 --- a/SessionMessagingKit/Database/Models/Interaction.swift +++ b/SessionMessagingKit/Database/Models/Interaction.swift @@ -847,7 +847,7 @@ public extension Interaction { // MARK: - Variables var isExpiringMessage: Bool { - guard variant == .standardIncoming || variant == .standardOutgoing else { return false } + guard variant.shouldFollowDisappearingMessagesConfiguration else { return false } return (expiresInSeconds ?? 0 > 0) }