From 71adb6855dca2d35be679047e5c93ea44283b6d5 Mon Sep 17 00:00:00 2001 From: Christian Pauly Date: Sat, 28 Aug 2021 11:09:37 +0200 Subject: [PATCH] feat: Compatible with Famedly and Element QR Codes --- lib/utils/url_launcher.dart | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/utils/url_launcher.dart b/lib/utils/url_launcher.dart index 66be0fef4..6d9dfeef6 100644 --- a/lib/utils/url_launcher.dart +++ b/lib/utils/url_launcher.dart @@ -76,7 +76,12 @@ class UrlLauncher { // The identifier might be a matrix.to url and needs escaping. Or, it might have multiple // identifiers (room id & event id), or it might also have a query part. // All this needs parsing. - final identityParts = url.parseIdentifierIntoParts(); + final identityParts = url.parseIdentifierIntoParts() ?? + Uri.tryParse(url)?.host?.parseIdentifierIntoParts() ?? + Uri.tryParse(url) + ?.pathSegments + ?.lastWhere((_) => true, orElse: () => null) + ?.parseIdentifierIntoParts(); if (identityParts == null) { return; // no match, nothing to do }