mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-27 19:56:57 +02:00
matrix.to: Cannot open/preview a new room given by alias
#3991 Add a patch to try to build the right string and to avoid to loop forever
This commit is contained in:
@@ -1380,9 +1380,27 @@ NSString *const AppDelegateUniversalLinkDidChangeNotification = @"AppDelegateUni
|
||||
withString:[MXTools encodeURIComponent:roomId]
|
||||
];
|
||||
|
||||
universalLinkFragmentPendingRoomAlias = @{roomId: roomIdOrAlias};
|
||||
// The previous operation can fail because of percent encoding
|
||||
// TBH we are not clean on data inputs. For the moment, just give another try with no encoding
|
||||
// TODO: Have a dedicated module and tests to handle universal links (matrix.to, email link, etc)
|
||||
if ([newUniversalLinkFragment isEqualToString:fragment])
|
||||
{
|
||||
newUniversalLinkFragment =
|
||||
[fragment stringByReplacingOccurrencesOfString:roomIdOrAlias
|
||||
withString:[MXTools encodeURIComponent:roomId]];
|
||||
}
|
||||
|
||||
[self handleUniversalLinkFragment:newUniversalLinkFragment];
|
||||
if (![newUniversalLinkFragment isEqualToString:fragment])
|
||||
{
|
||||
universalLinkFragmentPendingRoomAlias = @{roomId: roomIdOrAlias};
|
||||
|
||||
[self handleUniversalLinkFragment:newUniversalLinkFragment];
|
||||
}
|
||||
else
|
||||
{
|
||||
// Do not continue. Else we will loop forever
|
||||
NSLog(@"[AppDelegate] Universal link: Error: Cannot resolve alias in %@ to the room id %@", fragment, roomId);
|
||||
}
|
||||
}
|
||||
|
||||
} failure:^(NSError *error) {
|
||||
|
||||
Reference in New Issue
Block a user