Universal link: Moved isUniversalLink and fixURLWithSeveralHashKeys methods from AppDelegate to Tools

This commit is contained in:
manuroe
2016-04-29 16:19:13 +02:00
parent 04e24a2979
commit 673772d074
5 changed files with 72 additions and 64 deletions
+7 -9
View File
@@ -60,6 +60,7 @@
#import "MXKRoomBubbleTableViewCell+Vector.h"
#import "AvatarGenerator.h"
#import "Tools.h"
#import "VectorDesignValues.h"
@@ -1374,18 +1375,15 @@
// Try to catch universal link supported by the app
NSURL *url = userInfo[kMXKRoomBubbleCellUrl];
// iOS Patch: fix vector.im urls before using it
if ([url.host isEqualToString:@"vector.im"])
// If the link can be open it by the app, let it do
if ([Tools isUniversalLink:url])
{
url = [AppDelegate fixURLWithSeveralHashKeys:url];
shouldDoAction = NO;
// If the link can be open it by the app, let it do
if ([[AppDelegate theDelegate] isUniversalLink:url])
{
shouldDoAction = NO;
// iOS Patch: fix vector.im urls before using it
url = [Tools fixURLWithSeveralHashKeys:url];
[[AppDelegate theDelegate] handleUniversalLinkFragment:url.fragment];
}
[[AppDelegate theDelegate] handleUniversalLinkFragment:url.fragment];
}
}