use the Matrix SDK's method for percent encoding

This commit is contained in:
fridtjof
2019-02-18 15:31:55 +01:00
parent 23ed49d186
commit 7ba712a6b6
6 changed files with 15 additions and 21 deletions
+3 -6
View File
@@ -2805,8 +2805,7 @@
NSString *roomIdOrAlias = absoluteURLString;
// Open the room or preview it
NSString *fragment = [NSString stringWithFormat:@"/room/%@",
[roomIdOrAlias stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLPathAllowedCharacterSet]]];
NSString *fragment = [NSString stringWithFormat:@"/room/%@", [MXTools encodeURIComponent:roomIdOrAlias]];
[[AppDelegate theDelegate] handleUniversalLinkFragment:fragment];
}
// Preview the clicked group
@@ -2815,8 +2814,7 @@
shouldDoAction = NO;
// Open the group or preview it
NSString *fragment = [NSString stringWithFormat:@"/group/%@",
[absoluteURLString stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLPathAllowedCharacterSet]]];
NSString *fragment = [NSString stringWithFormat:@"/group/%@", [MXTools encodeURIComponent:absoluteURLString]];
[[AppDelegate theDelegate] handleUniversalLinkFragment:fragment];
}
else if ([absoluteURLString hasPrefix:kEventFormatterOnReRequestKeysLinkAction])
@@ -3963,8 +3961,7 @@
else if (customizedRoomDataSource.roomState.isObsolete)
{
NSString *replacementRoomId = customizedRoomDataSource.roomState.tombStoneContent.replacementRoomId;
NSString *roomLinkFragment = [NSString stringWithFormat:@"/room/%@",
[replacementRoomId stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLPathAllowedCharacterSet]]];
NSString *roomLinkFragment = [NSString stringWithFormat:@"/room/%@", [MXTools encodeURIComponent:replacementRoomId]];
[roomActivitiesView displayRoomReplacementWithRoomLinkTappedHandler:^{
[[AppDelegate theDelegate] handleUniversalLinkFragment:roomLinkFragment];