mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 21:33:26 +00:00
Handle tap on user mentions (#1850)
* user mention routing implemented * more tests * better naming * fixed a test
This commit is contained in:
@@ -158,6 +158,8 @@ class AppCoordinator: AppCoordinatorProtocol, AuthenticationCoordinatorDelegate,
|
||||
} else {
|
||||
navigationRootCoordinator.setSheetCoordinator(GenericCallLinkCoordinator(parameters: .init(url: url)))
|
||||
}
|
||||
case .roomMemberDetails:
|
||||
userSessionFlowCoordinator?.handleAppRoute(route, animated: true)
|
||||
default:
|
||||
break
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@ enum AppRoute: Equatable {
|
||||
case roomList
|
||||
case room(roomID: String)
|
||||
case roomDetails(roomID: String)
|
||||
case roomMemberDetails(userID: String)
|
||||
case invites
|
||||
case genericCallLink(url: URL)
|
||||
}
|
||||
@@ -30,6 +31,7 @@ struct AppRouteURLParser {
|
||||
|
||||
init(appSettings: AppSettings) {
|
||||
urlParsers = [
|
||||
MatrixPermalinkParser(appSettings: appSettings),
|
||||
OIDCCallbackURLParser(appSettings: appSettings),
|
||||
ElementCallURLParser()
|
||||
]
|
||||
@@ -105,3 +107,17 @@ struct ElementCallURLParser: URLParser {
|
||||
return .genericCallLink(url: url)
|
||||
}
|
||||
}
|
||||
|
||||
struct MatrixPermalinkParser: URLParser {
|
||||
let appSettings: AppSettings
|
||||
|
||||
func route(from url: URL) -> AppRoute? {
|
||||
switch PermalinkBuilder.detectPermalink(in: url, baseURL: appSettings.permalinkBaseURL) {
|
||||
case .userIdentifier(let userID):
|
||||
return .roomMemberDetails(userID: userID)
|
||||
// Other cases will be handled in the future
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user