feat: Handle matrix: URIs as per MSC2312

This commit is contained in:
Sorunome 2021-01-10 18:00:27 +01:00
commit 03058d44e6
15 changed files with 41 additions and 101 deletions

View file

@ -105,7 +105,9 @@ class _ChatListState extends State<ChatList> {
if (Navigator.of(context).canPop()) {
Navigator.of(context).popUntil((r) => r.isFirst);
}
if (text.startsWith(AppConfig.inviteLinkPrefix)) {
if (text.toLowerCase().startsWith(AppConfig.inviteLinkPrefix) ||
(text.toLowerCase().startsWith(AppConfig.schemePrefix) &&
!RegExp(r'\s').hasMatch(text))) {
UrlLauncher(context, text).openMatrixToUrl();
return;
}