Integrations: Make code support use of an integration manager other than modular/scalar.

The default value is still modular/scalar.
This commit is contained in:
manuroe
2019-06-21 10:23:10 +02:00
parent 88f7f8d792
commit 089835f3f4
7 changed files with 226 additions and 33 deletions
@@ -1,5 +1,6 @@
/*
Copyright 2017 Vector Creations Ltd
Copyright 2019 New Vector Ltd
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -17,6 +18,7 @@
#import "IntegrationManagerViewController.h"
#import "WidgetManager.h"
#import "Riot-Swift.h"
NSString *const kIntegrationManagerMainScreen = nil;
NSString *const kIntegrationManagerAddIntegrationScreen = @"add_integ";
@@ -100,10 +102,12 @@ NSString *const kIntegrationManagerAddIntegrationScreen = @"add_integ";
{
NSMutableString *url;
NSString *integrationsUiUrl = [[WidgetManager sharedManager] configForUser:mxSession.myUser.userId].uiUrl;
if (scalarToken)
{
url = [NSMutableString stringWithFormat:@"%@?scalar_token=%@&room_id=%@",
[[NSUserDefaults standardUserDefaults] objectForKey:@"integrationsUiUrl"],
integrationsUiUrl,
[MXTools encodeURIComponent:scalarToken],
[MXTools encodeURIComponent:roomId]
];