forked from Henry-Hiles/nexus
joining rooms from matrix uri or plaintext
This commit is contained in:
parent
cafdf43fd3
commit
82b6f2c647
5 changed files with 99 additions and 68 deletions
|
|
@ -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 (_) {}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue