Avoid stable prefix

This commit is contained in:
Benoit Marty 2022-03-09 10:48:35 +01:00
parent 20c1886fed
commit 67a24b38cb
2 changed files with 3 additions and 6 deletions

View File

@ -39,7 +39,7 @@ class UrlMapProvider @Inject constructor(
suspend fun getMapUrl(): String {
val upstreamMapUrl = tryOrNull { rawService.getElementWellknown(session.sessionParams) }
?.mapTileServerConfig
?.getBestMapTileServerConfig()
?.mapStyleUrl
return upstreamMapUrl ?: fallbackMapUrl
}

View File

@ -41,12 +41,9 @@ data class ElementWellKnown(
val unstableMapTileServerConfig: MapTileServerConfig? = null,
@Json(name = "m.tile_server")
val stableMapTileServerConfig: MapTileServerConfig? = null
val mapTileServerConfig: MapTileServerConfig? = null
) {
@Transient
var mapTileServerConfig: MapTileServerConfig? = null
get() = stableMapTileServerConfig ?: unstableMapTileServerConfig
fun getBestMapTileServerConfig() = mapTileServerConfig ?: unstableMapTileServerConfig
}
@JsonClass(generateAdapter = true)