Apply the GetUrlResolver pattern using unauthenticated matrix clients where possible

This commit is contained in:
Jorge Martín
2026-08-10 14:26:10 +02:00
committed by Jorge Martin Espinosa
parent 25eca29cd2
commit 90d4fbe0bd
8 changed files with 97 additions and 49 deletions
@@ -7,12 +7,19 @@
package io.element.android.libraries.matrix.api.scanner
import io.element.android.libraries.matrix.api.GetUrlResolver
import io.element.android.libraries.matrix.api.core.SessionId
/**
* Provides the URL of the content scanner service for a given homeserver, if any is set up.
*/
fun interface ContentScannerUrlProvider {
/**
* Returns the URL of the content scanner service for the given [homeserver], or `null` if no content scanner is set up.
* Returns the URL of the content scanner service for the given [sessionId], or `null` if no content scanner is set up.
*/
suspend fun getContentScannerUrl(homeserver: String): Result<String?>
suspend fun getContentScannerUrl(sessionId: SessionId): Result<String?>
fun interface Factory {
fun create(getUrlResolver: GetUrlResolver): ContentScannerUrlProvider
}
}