joining rooms from matrix uri or plaintext

This commit is contained in:
Henry Hiles 2026-01-30 20:22:51 +01:00
commit 82b6f2c647
No known key found for this signature in database
5 changed files with 99 additions and 68 deletions

View file

@ -29,7 +29,11 @@ extension LinkToMention on String {
if (uri.pathSegments.isNotEmpty) {
final identifier = uri.pathSegments.last;
if (identifier.isNotEmpty) {
return Uri.decodeComponent(identifier);
return "${switch (uri.pathSegments.firstOrNull) {
"r" || "roomid" => "#",
"u" => "@",
_ => "",
}}${Uri.decodeComponent(identifier)}";
}
}
} catch (_) {}