From 45ed840e83d73122a70d5fd16aeb0be5cb5593c0 Mon Sep 17 00:00:00 2001 From: Chris Smith Date: Fri, 30 Jun 2023 09:48:10 +0100 Subject: [PATCH] Fix missing data class after merge --- .../io/element/android/features/location/api/GeoUris.kt | 6 ++++++ 1 file changed, 6 insertions(+) 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 (