another.im-ios/ConversationsClassic/AppCore/Middlewares/FileMiddleware.swift
2024-07-11 15:59:24 +02:00

22 lines
565 B
Swift

import Combine
final class FileMiddleware {
static let shared = AccountsMiddleware()
func middleware(state _: AppState, action: AppAction) -> AnyPublisher<AppAction, Never> {
switch action {
case .conversationAction(.messagesUpdated(let messages)):
for msg in messages {
if msg.attachment != nil {
print("Attachment found")
}
}
return Empty().eraseToAnyPublisher()
default:
return Empty().eraseToAnyPublisher()
}
}
}