From 794c50fed0530b2acf3cd1b120f584accab51ddc Mon Sep 17 00:00:00 2001 From: fmodf Date: Wed, 7 Aug 2024 13:45:04 +0200 Subject: [PATCH] wip --- .../AppCore/Middlewares/MessagesMiddleware.swift | 2 +- ConversationsClassic/Helpers/Const.swift | 2 +- .../View/Screens/Create/AddContactOrChannelScreen.swift | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ConversationsClassic/AppCore/Middlewares/MessagesMiddleware.swift b/ConversationsClassic/AppCore/Middlewares/MessagesMiddleware.swift index 5ee63ca..f842413 100644 --- a/ConversationsClassic/AppCore/Middlewares/MessagesMiddleware.swift +++ b/ConversationsClassic/AppCore/Middlewares/MessagesMiddleware.swift @@ -12,7 +12,7 @@ final class MessagesMiddleware { let features = state.accountsState.discoFeatures[currentClient.bareJid] ?? [] if features.map({ $0.xep }).contains("XEP-0313") { let oldestMessageDate = state.conversationsState.currentMessages.first?.date ?? Date() - let archivesRequestDate = Calendar.current.date(byAdding: .day, value: -7, to: oldestMessageDate) ?? Date() + let archivesRequestDate = Calendar.current.date(byAdding: .day, value: -Const.mamRequestLength, to: oldestMessageDate) ?? Date() promise(.success(.xmppAction(.xmppLoadArchivedMessages(jid: currentClient.bareJid, to: roster?.bareJid, fromDate: archivesRequestDate)))) } else { promise(.success(.info("MessageMiddleware: XEP-0313 not supported for client \(currentClient.bareJid)"))) diff --git a/ConversationsClassic/Helpers/Const.swift b/ConversationsClassic/Helpers/Const.swift index 465e812..2f1e35c 100644 --- a/ConversationsClassic/Helpers/Const.swift +++ b/ConversationsClassic/Helpers/Const.swift @@ -45,5 +45,5 @@ enum Const { static let attachmentPreviewSize = UIScreen.main.bounds.width * 0.5 // Lenght in days for MAM request - static let mamRequestLength = 7 + static let mamRequestLength = 30 } diff --git a/ConversationsClassic/View/Screens/Create/AddContactOrChannelScreen.swift b/ConversationsClassic/View/Screens/Create/AddContactOrChannelScreen.swift index 6f60ffc..56897f7 100644 --- a/ConversationsClassic/View/Screens/Create/AddContactOrChannelScreen.swift +++ b/ConversationsClassic/View/Screens/Create/AddContactOrChannelScreen.swift @@ -29,7 +29,7 @@ struct AddContactOrChannelScreen: View { // Header SharedNavigationBar( leftButton: .init( - image: Image(systemName: "chevron.left"), + image: Image(systemName: "xmark"), action: { isPresented = false }