Merge pull request #6396 from vector-im/aringenbach/6395_fix_room_links

Fix inoperant room links with alias/identifiers
This commit is contained in:
aringenbach 2022-07-12 09:28:02 +02:00 committed by GitHub
commit b671b026c0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 2 deletions

View file

@ -1312,8 +1312,17 @@ NSString *const AppDelegateUniversalLinkDidChangeNotification = @"AppDelegateUni
// Sanity check
if (!pathParams.count)
{
MXLogDebug(@"[AppDelegate] Universal link: Error: No path parameters");
return NO;
// Handle simple room links with aliases/identifiers as UniversalLink will not parse these.
NSString* absoluteUrl = [universalLink.url.absoluteString stringByRemovingPercentEncoding];
if ([MXTools isMatrixRoomAlias:absoluteUrl]
|| [MXTools isMatrixRoomIdentifier:absoluteUrl])
{
pathParams = @[absoluteUrl];
}
else {
MXLogDebug(@"[AppDelegate] Universal link: Error: No path parameters");
return NO;
}
}
NSString *roomIdOrAlias;

1
changelog.d/6395.bugfix Normal file
View file

@ -0,0 +1 @@
Fix inoperant room links with alias/identifiers