Skip to content

Commit

Permalink
Revert optionality and always pass url
Browse files Browse the repository at this point in the history
  • Loading branch information
Anderas committed Mar 22, 2022
1 parent f3aef51 commit 413a1eb
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 18 deletions.
8 changes: 0 additions & 8 deletions Riot/Modules/Application/LegacyAppDelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 0 additions & 6 deletions Riot/Modules/Application/LegacyAppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -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

{
Expand Down
3 changes: 2 additions & 1 deletion Riot/Modules/Common/Recents/RecentsViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}
Expand Down
2 changes: 1 addition & 1 deletion Riot/Modules/Communities/Home/GroupHomeViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions Riot/Modules/DeepLink/UniversalLinkParameters.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -34,7 +34,7 @@ class UniversalLinkParameters: NSObject {
// MARK: - Setup

init(fragment: String,
universalLinkURL: URL?,
universalLinkURL: URL,
presentationParameters: ScreenPresentationParameters) {
self.fragment = fragment
self.universalLinkURL = universalLinkURL
Expand Down

0 comments on commit 413a1eb

Please sign in to comment.