diff --git a/Riot/Utils/UniversalLink.m b/Riot/Utils/UniversalLink.m index edd73c7b8..2f1a97936 100644 --- a/Riot/Utils/UniversalLink.m +++ b/Riot/Utils/UniversalLink.m @@ -16,6 +16,7 @@ #import "UniversalLink.h" #import "NSArray+Element.h" +#import "MXTools.h" @implementation UniversalLink @@ -51,6 +52,13 @@ // Remove the first empty path param string pathParams = [pathParams filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:@"length > 0"]]; + // Handle room links with aliases/identifiers + if ([MXTools isMatrixRoomAlias:[_url.absoluteString stringByRemovingPercentEncoding]] + || [MXTools isMatrixRoomIdentifier:[_url.absoluteString stringByRemovingPercentEncoding]]) + { + pathParams = @[_url.absoluteString]; + } + // URL decode each path param pathParams = [pathParams vc_map:^id _Nonnull(NSString * _Nonnull item) { return [item stringByRemovingPercentEncoding]; diff --git a/changelog.d/6395.bugfix b/changelog.d/6395.bugfix new file mode 100644 index 000000000..0bafa6d70 --- /dev/null +++ b/changelog.d/6395.bugfix @@ -0,0 +1 @@ +Fix inoperant room links with alias/identifiers