Content Scanner Service (#5826)

* implemented the content scanner service with caching and a way to use in the state store context

* fix swiftformat comment enforcing

* pr suggestions
This commit is contained in:
Mauro
2026-07-02 17:12:39 +02:00
committed by GitHub
parent f2d08c23a3
commit 5ea4b46604
15 changed files with 480 additions and 7 deletions
@@ -20,6 +20,7 @@ class ClientProxy: ClientProxyProtocol {
private let analyticsService: AnalyticsServiceProtocol
let mediaLoader: MediaLoaderProtocol
let contentScanner: ContentScannerProxyProtocol?
private let clientQueue: DispatchQueue
private var roomListService: RoomListService
@@ -219,6 +220,16 @@ class ClientProxy: ClientProxyProtocol {
mediaLoader = MediaLoader(client: client)
// Route media downloads through a content scanner when one has been configured for the server,
// and expose a proxy for the active scanning of content in the timeline.
if let contentScannerURL = appSettings.contentScannerURL.publisher.value, let client = client as? Client {
let scanner = ContentScanner(scannerUrl: contentScannerURL.absoluteString)
await client.setContentScanner(contentScanner: scanner)
contentScanner = ContentScannerProxy(contentScanner: scanner, client: client)
} else {
contentScanner = nil
}
notificationSettings = await NotificationSettingsProxy(notificationSettings: client.getNotificationSettings())
secureBackupController = SecureBackupController(encryption: client.encryption())