mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-02 12:07:28 +00:00
Rework WellknownRetriever so it uses the GetUrlResolver
Also, allow instantiating it using a factory: with this we can always decide where to take the config from and how to do it Do the same for `ElementWellknownStore` so we can store and restore the values for different sources (endpoints) independently
This commit is contained in:
committed by
Jorge Martin Espinosa
parent
3f19100427
commit
25eca29cd2
@@ -12,3 +12,7 @@ plugins {
|
||||
android {
|
||||
namespace = "io.element.android.libraries.wellknown.api"
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation(projects.libraries.matrix.api)
|
||||
}
|
||||
|
||||
+4
@@ -11,4 +11,8 @@ interface ElementWellknownStore {
|
||||
suspend fun get(domain: String): WellknownRetrieverResult<ElementWellKnown>
|
||||
suspend fun update(domain: String, wellknown: String): Result<Unit>
|
||||
suspend fun delete(domain: String): Result<Unit>
|
||||
|
||||
fun interface Factory {
|
||||
fun create(prefix: String?): ElementWellknownStore
|
||||
}
|
||||
}
|
||||
|
||||
+10
-1
@@ -8,6 +8,15 @@
|
||||
|
||||
package io.element.android.libraries.wellknown.api
|
||||
|
||||
import io.element.android.libraries.matrix.api.GetUrlResolver
|
||||
|
||||
interface WellknownRetriever {
|
||||
suspend fun getElementWellKnown(baseUrl: String): WellknownRetrieverResult<ElementWellKnown>
|
||||
suspend fun getElementWellKnown(
|
||||
host: String,
|
||||
source: EnterpriseRemoteConfigSource
|
||||
): WellknownRetrieverResult<ElementWellKnown>
|
||||
|
||||
interface Factory {
|
||||
fun create(getUrlResolver: GetUrlResolver): WellknownRetriever
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user