mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-10-31 16:24:11 +00:00
5ea4b46604
* implemented the content scanner service with caching and a way to use in the state store context * fix swiftformat comment enforcing * pr suggestions
22 lines
754 B
Swift
22 lines
754 B
Swift
//
|
|
// Copyright 2026 Element Creations Ltd.
|
|
//
|
|
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial.
|
|
// Please see LICENSE files in the repository root for full details.
|
|
//
|
|
|
|
import Foundation
|
|
|
|
enum ContentScannerProxyError: Error {
|
|
case missingClient
|
|
case sdkError(Error)
|
|
}
|
|
|
|
// sourcery: AutoMockable
|
|
/// A thin wrapper around the SDK's content scanner. Given a media source it asks the scanner server
|
|
/// whether the content is clean (safe). It holds no state and no product logic - see
|
|
/// ``ContentScannerServiceProtocol`` for caching, per-event tracking and validation state.
|
|
protocol ContentScannerProxyProtocol: Sendable {
|
|
func scan(mediaSource: MediaSourceProxy) async -> Result<Bool, ContentScannerProxyError>
|
|
}
|