diff --git a/ElementX/Sources/Application/AppCoordinator.swift b/ElementX/Sources/Application/AppCoordinator.swift index 6850b5188a..a8e24b7330 100644 --- a/ElementX/Sources/Application/AppCoordinator.swift +++ b/ElementX/Sources/Application/AppCoordinator.swift @@ -158,7 +158,7 @@ class AppCoordinator: AppCoordinatorProtocol, AuthenticationCoordinatorDelegate, } else { navigationRootCoordinator.setSheetCoordinator(GenericCallLinkCoordinator(parameters: .init(url: url))) } - case .roomMemberDetails: + case .roomMemberDetails, .room: userSessionFlowCoordinator?.handleAppRoute(route, animated: true) default: break diff --git a/ElementX/Sources/Application/Navigation/AppRoutes.swift b/ElementX/Sources/Application/Navigation/AppRoutes.swift index b217c4b3c2..5ab60e0532 100644 --- a/ElementX/Sources/Application/Navigation/AppRoutes.swift +++ b/ElementX/Sources/Application/Navigation/AppRoutes.swift @@ -115,7 +115,8 @@ struct MatrixPermalinkParser: URLParser { switch PermalinkBuilder.detectPermalink(in: url, baseURL: appSettings.permalinkBaseURL) { case .userIdentifier(let userID): return .roomMemberDetails(userID: userID) - // Other cases will be handled in the future + case .roomIdentifier(let roomID): + return .room(roomID: roomID) default: return nil } diff --git a/UnitTests/Sources/AppRouteURLParserTests.swift b/UnitTests/Sources/AppRouteURLParserTests.swift index 7a0326875c..44319eeb50 100644 --- a/UnitTests/Sources/AppRouteURLParserTests.swift +++ b/UnitTests/Sources/AppRouteURLParserTests.swift @@ -120,4 +120,16 @@ class AppRouteURLParserTests: XCTestCase { XCTAssertEqual(route, .roomMemberDetails(userID: userID)) } + + func testMatrixRoomIdentifierURL() { + let id = "!abcdefghijklmnopqrstuvwxyz1234567890:matrix.org" + guard let url = URL(string: "\(appSettings.permalinkBaseURL)/#/\(id)") else { + XCTFail("Invalid url") + return + } + + let route = appRouteURLParser.route(from: url) + + XCTAssertEqual(route, .room(roomID: id)) + } } diff --git a/changelog.d/pr-1853.feature b/changelog.d/pr-1853.feature new file mode 100644 index 0000000000..0c4aed5bcc --- /dev/null +++ b/changelog.d/pr-1853.feature @@ -0,0 +1 @@ +Tapping on matrix room id link brings you to that room. \ No newline at end of file