diff --git a/CHANGES.rst b/CHANGES.rst index 507513d45f..453202661c 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,3 +1,10 @@ +Changes in 0.9.3 (2019-09-10) +=============================================== + +Improvements: + * Support Riot configuration link to customise HS and IS (#2703). + * Authentication: Create a way to filter and prioritise flows (with handleSupportedFlowsInAuthenticationSession). + Changes in 0.9.2 (2019-08-08) =============================================== diff --git a/Riot/AppDelegate.m b/Riot/AppDelegate.m index 9e6cf8f5b4..10b8beeedd 100644 --- a/Riot/AppDelegate.m +++ b/Riot/AppDelegate.m @@ -2100,6 +2100,11 @@ - (BOOL)handleUniversalLink:(NSUserActivity*)userActivity // iOS Patch: fix vector.im urls before using it webURL = [Tools fixURLWithSeveralHashKeys:webURL]; + + if ([webURL.path hasPrefix:@"/config"]) + { + return [self handleServerProvionningLink:webURL]; + } // Manage email validation link if ([webURL.path isEqualToString:@"/_matrix/identity/api/v1/validate/email/submitToken"]) @@ -2547,6 +2552,93 @@ - (void)parseUniversalLinkFragment:(NSString*)fragment outPathParams:(NSArray String { return VectorL10n.tr("Vector", "event_formatter_jitsi_widget_added", p1) diff --git a/Riot/Modules/Authentication/AuthenticationViewController.h b/Riot/Modules/Authentication/AuthenticationViewController.h index 9c24ea4f19..f854a0a1c7 100644 --- a/Riot/Modules/Authentication/AuthenticationViewController.h +++ b/Riot/Modules/Authentication/AuthenticationViewController.h @@ -45,5 +45,7 @@ @property (weak, nonatomic) IBOutlet UILabel *softLogoutClearDataLabel; @property (weak, nonatomic) IBOutlet UIButton *softLogoutClearDataButton; +- (void)showCustomHomeserver:(NSString*)homeserver andIdentityServer:(NSString*)identityServer; + @end diff --git a/Riot/Modules/Authentication/AuthenticationViewController.m b/Riot/Modules/Authentication/AuthenticationViewController.m index d557ec443b..46def1f3a2 100644 --- a/Riot/Modules/Authentication/AuthenticationViewController.m +++ b/Riot/Modules/Authentication/AuthenticationViewController.m @@ -497,9 +497,61 @@ - (void)clearDataAfterSoftLogout }]; } +/** + Filter and prioritise flows supported by the app. + + @param authSession the auth session coming from the HS. + @return a new auth session + */ +- (MXAuthenticationSession*)handleSupportedFlowsInAuthenticationSession:(MXAuthenticationSession *)authSession +{ + MXLoginFlow *ssoFlow; + NSMutableArray *supportedFlows = [NSMutableArray array]; + + for (MXLoginFlow *flow in authSession.flows) + { + // Remove known flows we do not support + if (![flow.type isEqualToString:kMXLoginFlowTypeToken]) + { + NSLog(@"[AuthenticationVC] handleSupportedFlowsInAuthenticationSession: Filter out flow %@", flow.type); + [supportedFlows addObject:flow]; + } + + // Prioritise SSO over other flows + if ([flow.type isEqualToString:kMXLoginFlowTypeSSO] + || [flow.type isEqualToString:kMXLoginFlowTypeCAS]) + { + NSLog(@"[AuthenticationVC] handleSupportedFlowsInAuthenticationSession: Prioritise flow %@", flow.type); + ssoFlow = flow; + break; + } + } + + if (ssoFlow) + { + [supportedFlows removeAllObjects]; + [supportedFlows addObject:ssoFlow]; + } + + if (supportedFlows.count != authSession.flows.count) + { + MXAuthenticationSession *updatedAuthSession = [[MXAuthenticationSession alloc] init]; + updatedAuthSession.session = authSession.session; + updatedAuthSession.params = authSession.params; + updatedAuthSession.flows = supportedFlows; + return updatedAuthSession; + } + else + { + return authSession; + } +} - (void)handleAuthenticationSession:(MXAuthenticationSession *)authSession { + // Make some cleaning from the server response according to what the app supports + authSession = [self handleSupportedFlowsInAuthenticationSession:authSession]; + [super handleAuthenticationSession:authSession]; AuthInputsView *authInputsview; diff --git a/Riot/SupportingFiles/Info.plist b/Riot/SupportingFiles/Info.plist index 2ee99817eb..311996ec82 100644 --- a/Riot/SupportingFiles/Info.plist +++ b/Riot/SupportingFiles/Info.plist @@ -17,11 +17,11 @@ CFBundlePackageType APPL CFBundleShortVersionString - 0.9.2 + 0.9.3 CFBundleSignature ???? CFBundleVersion - 0.9.2 + 0.9.3 ITSAppUsesNonExemptEncryption ITSEncryptionExportComplianceCode diff --git a/RiotShareExtension/SupportingFiles/Info.plist b/RiotShareExtension/SupportingFiles/Info.plist index 4cc7b7bb6d..2653990ba9 100644 --- a/RiotShareExtension/SupportingFiles/Info.plist +++ b/RiotShareExtension/SupportingFiles/Info.plist @@ -17,9 +17,9 @@ CFBundlePackageType XPC! CFBundleShortVersionString - 0.9.2 + 0.9.3 CFBundleVersion - 0.9.2 + 0.9.3 NSExtension NSExtensionAttributes diff --git a/SiriIntents/Info.plist b/SiriIntents/Info.plist index 804ac1c8f0..b91b0372a7 100644 --- a/SiriIntents/Info.plist +++ b/SiriIntents/Info.plist @@ -17,9 +17,9 @@ CFBundlePackageType XPC! CFBundleShortVersionString - 0.9.2 + 0.9.3 CFBundleVersion - 0.9.2 + 0.9.3 NSExtension NSExtensionAttributes