diff --git a/ConversationsClassic/AppCore/Middlewares/ArchivedMessagesMiddleware.swift b/ConversationsClassic/AppCore/Middlewares/ArchivedMessagesMiddleware.swift index b55686f..bf0aa08 100644 --- a/ConversationsClassic/AppCore/Middlewares/ArchivedMessagesMiddleware.swift +++ b/ConversationsClassic/AppCore/Middlewares/ArchivedMessagesMiddleware.swift @@ -43,7 +43,7 @@ private extension ArchivedMessagesMiddleware { if let lastDate = messages.first?.date { return lastDate } else { - return Calendar.current.date(byAdding: .day, value: -Const.mamRequestLength, to: Date()) ?? Date() + return Calendar.current.date(byAdding: .day, value: -Const.mamRequestDaysLength, to: Date()) ?? Date() } } } diff --git a/ConversationsClassic/Helpers/Const.swift b/ConversationsClassic/Helpers/Const.swift index 2f1e35c..c96edfd 100644 --- a/ConversationsClassic/Helpers/Const.swift +++ b/ConversationsClassic/Helpers/Const.swift @@ -45,5 +45,9 @@ enum Const { static let attachmentPreviewSize = UIScreen.main.bounds.width * 0.5 // Lenght in days for MAM request - static let mamRequestLength = 30 + static let mamRequestDaysLength = 30 + + // Limits for messages pagination + static let messagesPageMin = 20 + static let messagesPageMax = 100 }