Universal link + next link: Forward the next_link parameters to AuthenticationVC

This commit is contained in:
manuroe
2016-04-21 16:19:16 +02:00
parent 767ac0044b
commit d58016b47b
5 changed files with 54 additions and 2 deletions
+26 -1
View File
@@ -43,6 +43,11 @@
UIImageView* createNewRoomImageView;
MXHTTPOperation *roomCreationRequest;
/**
Observer that check when the Authentification view controller has gone.
*/
id authViewControllerObserver;
}
@end
@@ -95,7 +100,13 @@
- (void)destroy
{
[super destroy];
if (authViewControllerObserver)
{
[[NSNotificationCenter defaultCenter] removeObserver:authViewControllerObserver];
authViewControllerObserver = nil;
}
if (roomCreationRequest)
{
[roomCreationRequest cancel];
@@ -528,6 +539,20 @@
DirectoryViewController *directoryViewController = segue.destinationViewController;
[directoryViewController displayWitDataSource:recentsDataSource.publicRoomsDirectoryDataSource];
}
else if ([[segue identifier] isEqualToString:@"showAuth"])
{
// Keep ref on the authentification view controller while it is displayed
// ie until we get the notification about a new account
_authViewController = segue.destinationViewController;
authViewControllerObserver = [[NSNotificationCenter defaultCenter] addObserverForName:kMXKAccountManagerDidAddAccountNotification object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *notif) {
_authViewController = nil;
[[NSNotificationCenter defaultCenter] removeObserver:authViewControllerObserver];
authViewControllerObserver = nil;
}];
}
}
// Hide back button title