diff --git a/features/location/api/src/main/kotlin/io/element/android/features/location/api/GeoUris.kt b/features/location/api/src/main/kotlin/io/element/android/features/location/api/GeoUris.kt index c6187a816c..2986d50591 100644 --- a/features/location/api/src/main/kotlin/io/element/android/features/location/api/GeoUris.kt +++ b/features/location/api/src/main/kotlin/io/element/android/features/location/api/GeoUris.kt @@ -18,6 +18,12 @@ package io.element.android.features.location.api private const val GEO_URI_REGEX = """geo:(?-?\d+(?:\.\d+)?),(?-?\d+(?:\.\d+)?)(?:;u=(?\d+(?:\.\d+)?))?""" +data class Location( + val lat: Double, + val lon: Double, + val accuracy: Float, +) + fun parseGeoUri(geoUri: String): Location? { val result = Regex(GEO_URI_REGEX).matchEntire(geoUri) ?: return null return Location (