diff --git a/Riot/Modules/Application/LegacyAppDelegate.h b/Riot/Modules/Application/LegacyAppDelegate.h index 40e3c23771..6875c7d0df 100644 --- a/Riot/Modules/Application/LegacyAppDelegate.h +++ b/Riot/Modules/Application/LegacyAppDelegate.h @@ -227,14 +227,6 @@ UINavigationControllerDelegate // Reopen an existing direct room with this userId or creates a new one (if it doesn't exist) - (void)startDirectChatWithUserId:(NSString*)userId completion:(void (^)(void))completion; -/** - Process the fragment part of a vector.im link. - - @param fragment the fragment part of the universal link. - @return YES in case of processing success. - */ -- (BOOL)handleUniversalLinkFragment:(NSString*)fragment; - /** Process the fragment part of a vector.im link. diff --git a/Riot/Modules/Application/LegacyAppDelegate.m b/Riot/Modules/Application/LegacyAppDelegate.m index 989ed7b959..49ea844c96 100644 --- a/Riot/Modules/Application/LegacyAppDelegate.m +++ b/Riot/Modules/Application/LegacyAppDelegate.m @@ -1263,12 +1263,6 @@ - (BOOL)handleUniversalLink:(NSUserActivity*)userActivity return [self handleUniversalLinkFragment:webURL.fragment fromURL:webURL]; } -- (BOOL)handleUniversalLinkFragment:(NSString*)fragment -{ - return [self handleUniversalLinkFragment:fragment fromURL:nil]; -} - - - (BOOL)handleUniversalLinkFragment:(NSString*)fragment fromURL:(NSURL*)universalLinkURL { diff --git a/Riot/Modules/Common/Recents/RecentsViewController.m b/Riot/Modules/Common/Recents/RecentsViewController.m index 25aa17ec9e..0c731f7237 100644 --- a/Riot/Modules/Common/Recents/RecentsViewController.m +++ b/Riot/Modules/Common/Recents/RecentsViewController.m @@ -1564,7 +1564,8 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath { // Open the room or preview it NSString *fragment = [NSString stringWithFormat:@"/room/%@", [MXTools encodeURIComponent:roomIdOrAlias]]; - [[AppDelegate theDelegate] handleUniversalLinkFragment:fragment]; + NSURL *url = [NSURL URLWithString:[MXTools permalinkToRoom:fragment]]; + [[AppDelegate theDelegate] handleUniversalLinkFragment:fragment fromURL:url]; } [tableView deselectRowAtIndexPath:indexPath animated:NO]; } diff --git a/Riot/Modules/Communities/Home/GroupHomeViewController.m b/Riot/Modules/Communities/Home/GroupHomeViewController.m index e1d940a992..d8a9e3ed3a 100644 --- a/Riot/Modules/Communities/Home/GroupHomeViewController.m +++ b/Riot/Modules/Communities/Home/GroupHomeViewController.m @@ -890,7 +890,7 @@ - (BOOL)textView:(UITextView *)textView shouldInteractWithURL:(NSURL *)URL inRan // Open the group or preview it NSString *fragment = [NSString stringWithFormat:@"/group/%@", [MXTools encodeURIComponent:absoluteURLString]]; - [[AppDelegate theDelegate] handleUniversalLinkFragment:fragment]; + [[AppDelegate theDelegate] handleUniversalLinkFragment:fragment fromURL:URL]; } return shouldInteractWithURL; diff --git a/Riot/Modules/DeepLink/UniversalLinkParameters.swift b/Riot/Modules/DeepLink/UniversalLinkParameters.swift index 63fbf6a1e6..6ebe180eda 100644 --- a/Riot/Modules/DeepLink/UniversalLinkParameters.swift +++ b/Riot/Modules/DeepLink/UniversalLinkParameters.swift @@ -23,7 +23,7 @@ class UniversalLinkParameters: NSObject { // MARK: - Properties /// The unprocessed universal link URL - let universalLinkURL: URL? + let universalLinkURL: URL /// The fragment part of the universal link let fragment: String @@ -34,7 +34,7 @@ class UniversalLinkParameters: NSObject { // MARK: - Setup init(fragment: String, - universalLinkURL: URL?, + universalLinkURL: URL, presentationParameters: ScreenPresentationParameters) { self.fragment = fragment self.universalLinkURL = universalLinkURL