the base domain permalinks don't have the mxid in the first param but in the second after /user/mxid

This commit is contained in:
cfriedlander 2021-07-26 14:25:31 +02:00
parent bdbfbe6175
commit 618ab6c862

View File

@ -53,7 +53,12 @@ object PermalinkParser {
.filter { it.isNotEmpty() }
.take(2)
val identifier = params.getOrNull(0)
// the base domain permalinks don't have the mxid in the first param but in the second after /user/mxid
var identifier = params.getOrNull(0);
if (identifier.equals("user")) {
identifier = params.getOrNull(1)
}
val extraParameter = params.getOrNull(1)
return when {
identifier.isNullOrEmpty() -> PermalinkData.FallbackLink(uri)