diff --git a/changelog.d/3735.bugfix b/changelog.d/3735.bugfix new file mode 100644 index 0000000000..8262af627b --- /dev/null +++ b/changelog.d/3735.bugfix @@ -0,0 +1 @@ +the element-based domain permalinks (e.g. https://app.element.io/#/user/@chagai95:matrix.org) don't have the mxid in the first param (like matrix.to does - https://matrix.to/#/@chagai95:matrix.org) but rather in the second after /user/ so /user/mxid \ No newline at end of file diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/permalinks/PermalinkParser.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/permalinks/PermalinkParser.kt index e433f2a108..164a48a45b 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/permalinks/PermalinkParser.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/permalinks/PermalinkParser.kt @@ -21,12 +21,14 @@ import android.net.UrlQuerySanitizer import org.matrix.android.sdk.api.MatrixPatterns /** - * This class turns an uri to a [PermalinkData] + * This class turns a uri to a [PermalinkData] + * element-based domains (e.g. https://app.element.io/#/user/@chagai95:matrix.org) permalinks or matrix.to permalinks (e.g. https://matrix.to/#/@chagai95:matrix.org) + * */ object PermalinkParser { /** - * Turns an uri string to a [PermalinkData] + * Turns a uri string to a [PermalinkData] */ fun parse(uriString: String): PermalinkData { val uri = Uri.parse(uriString) @@ -34,7 +36,7 @@ object PermalinkParser { } /** - * Turns an uri to a [PermalinkData] + * Turns a uri to a [PermalinkData] */ fun parse(uri: Uri): PermalinkData { if (!uri.toString().startsWith(PermalinkService.MATRIX_TO_URL_BASE)) { @@ -53,7 +55,7 @@ object PermalinkParser { .filter { it.isNotEmpty() } .take(2) - // the base domain permalinks don't have the mxid in the first param but in the second after /user/mxid + // the the element-based domain permalinks (e.g. https://app.element.io/#/user/@chagai95:matrix.org) don't have the mxid in the first param (like matrix.to does - https://matrix.to/#/@chagai95:matrix.org) but rather in the second after /user/ so /user/mxid var identifier = params.getOrNull(0); if (identifier.equals("user")) { identifier = params.getOrNull(1)