diff --git a/Session/Conversations/Settings/ThreadDisappearingMessagesSettingsViewModel.swift b/Session/Conversations/Settings/ThreadDisappearingMessagesSettingsViewModel.swift index 8aea2a83e..c1327d539 100644 --- a/Session/Conversations/Settings/ThreadDisappearingMessagesSettingsViewModel.swift +++ b/Session/Conversations/Settings/ThreadDisappearingMessagesSettingsViewModel.swift @@ -140,7 +140,7 @@ class ThreadDisappearingMessagesSettingsViewModel: SessionTableViewModel 0 else { - return "YOU_DISAPPERING_MESSAGES_INFO_DISABLE".localized() + return "YOU_DISAPPEARING_MESSAGES_INFO_DISABLE".localized() } guard isPreviousOff == true else { return String( - format: "YOU_DISAPPERING_MESSAGES_INFO_UPDATE".localized(), + format: "YOU_DISAPPEARING_MESSAGES_INFO_UPDATE".localized(), floor(durationSeconds).formatted(format: .long), (type == .disappearAfterRead ? "MESSAGE_STATE_READ".localized() : "MESSAGE_STATE_SENT".localized()) ) } return String( - format: "YOU_DISAPPERING_MESSAGES_INFO_ENABLE".localized(), + format: "YOU_DISAPPEARING_MESSAGES_INFO_ENABLE".localized(), floor(durationSeconds).formatted(format: .long), (type == .disappearAfterRead ? "MESSAGE_STATE_READ".localized() : "MESSAGE_STATE_SENT".localized()) ) diff --git a/SessionMessagingKit/Sending & Receiving/Message Handling/MessageReceiver+ExpirationTimers.swift b/SessionMessagingKit/Sending & Receiving/Message Handling/MessageReceiver+ExpirationTimers.swift index 99cb3bd57..ee6b4f061 100644 --- a/SessionMessagingKit/Sending & Receiving/Message Handling/MessageReceiver+ExpirationTimers.swift +++ b/SessionMessagingKit/Sending & Receiving/Message Handling/MessageReceiver+ExpirationTimers.swift @@ -33,6 +33,14 @@ extension MessageReceiver { guard let defaultType: DisappearingMessagesConfiguration.DisappearingMessageType = maybeDefaultType else { return } + let defaultDuration: DisappearingMessagesConfiguration.DefaultDuration = { + switch defaultType { + case .unknown: return .unknown + case .disappearAfterRead: return .disappearAfterRead + case .disappearAfterSend: return .disappearAfterSend + } + }() + let localConfig: DisappearingMessagesConfiguration = try DisappearingMessagesConfiguration .filter(id: threadId) .fetchOne(db) @@ -43,7 +51,7 @@ extension MessageReceiver { isEnabled: ((message.duration ?? 0) > 0), durationSeconds: ( message.duration.map { TimeInterval($0) } ?? - defaultType.defaultDuration + defaultDuration.seconds ), type: defaultType )