diff --git a/Btchap/Config/BuildSettings.swift b/Btchap/Config/BuildSettings.swift index f577db02a..f3e2788fb 100644 --- a/Btchap/Config/BuildSettings.swift +++ b/Btchap/Config/BuildSettings.swift @@ -191,7 +191,8 @@ final class BuildSettings: NSObject { static let bugReportEndpointUrlSuffix = "/bugreports" // Use the name allocated by the bug report server static let bugReportApplicationId = "btchap-ios" - + static let bugReportUISIId = "element-auto-uisi" + // MARK: - Integrations static let integrationsUiUrlString = "https://scalar.vector.im/" @@ -237,6 +238,7 @@ final class BuildSettings: NSObject { static let tchapFeatureNotificationByEmail = "tchapFeatureNotificationByEmail" static let tchapFeatureVoiceOverIP = "tchapFeatureVoiceOverIP" static let tchapFeatureVideoOverIP = "tchapFeatureVideoOverIP" // Tchap: in pre-prod, allow any feature to any instance. + static let tchapFeatureAutoReportUisi = "tchapFeatureAutoReportUisi" static var tchapFeaturesAllowedHomeServersForFeature: [String: [String]] = [ tchapFeatureAnyFeature: [ tchapFeatureAnyHomeServer ] ] @@ -403,7 +405,7 @@ final class BuildSettings: NSObject { static let secretsRecoveryAllowReset = true // MARK: - UISI Autoreporting - static let cryptoUISIAutoReportingEnabled = false + static let cryptoUISIAutoReportingEnabled = true // Tchap // MARK: - Polls diff --git a/Config/BuildSettings.swift b/Config/BuildSettings.swift index b73ee1f6a..4d027526f 100644 --- a/Config/BuildSettings.swift +++ b/Config/BuildSettings.swift @@ -413,7 +413,7 @@ final class BuildSettings: NSObject { static let secretsRecoveryAllowReset = true // MARK: - UISI Autoreporting - static let cryptoUISIAutoReportingEnabled = false + static let cryptoUISIAutoReportingEnabled = true // Tchap // MARK: - Polls diff --git a/DevTchap/Config/BuildSettings.swift b/DevTchap/Config/BuildSettings.swift index 58ee2009f..824aed507 100644 --- a/DevTchap/Config/BuildSettings.swift +++ b/DevTchap/Config/BuildSettings.swift @@ -192,7 +192,8 @@ final class BuildSettings: NSObject { static let bugReportEndpointUrlSuffix = "/bugreports" // Use the name allocated by the bug report server static let bugReportApplicationId = "devtchap-ios" - + static let bugReportUISIId = "element-auto-uisi" + // MARK: - Integrations static let integrationsUiUrlString = "https://scalar.vector.im/" @@ -238,6 +239,7 @@ final class BuildSettings: NSObject { static let tchapFeatureNotificationByEmail = "tchapFeatureNotificationByEmail" static let tchapFeatureVoiceOverIP = "tchapFeatureVoiceOverIP" static let tchapFeatureVideoOverIP = "tchapFeatureVideoOverIP" // Tchap: in Dev, allow any feature to any instance. + static let tchapFeatureAutoReportUisi = "tchapFeatureAutoReportUisi" static var tchapFeaturesAllowedHomeServersForFeature: [String: [String]] = [ tchapFeatureAnyFeature: [ tchapFeatureAnyHomeServer ] ] @@ -404,7 +406,7 @@ final class BuildSettings: NSObject { static let secretsRecoveryAllowReset = true // MARK: - UISI Autoreporting - static let cryptoUISIAutoReportingEnabled = false + static let cryptoUISIAutoReportingEnabled = true // Tchap // MARK: - Polls diff --git a/Riot/Modules/Application/LegacyAppDelegate.m b/Riot/Modules/Application/LegacyAppDelegate.m index db266e53f..da8ea0b84 100644 --- a/Riot/Modules/Application/LegacyAppDelegate.m +++ b/Riot/Modules/Application/LegacyAppDelegate.m @@ -495,7 +495,9 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:( // Tchap: Disable Spaces // self.spaceFeatureUnavailablePresenter = [SpaceFeatureUnavailablePresenter new]; - // Tchap: Disable UISI + // Tchap: don't initialize UISIAutoReporter here because we don't have active account here + // to test if this feature is allozed for the current user. + // Try to activate it in `addMatrixSession` method. // self.uisiAutoReporter = [[UISIAutoReporter alloc] init]; // Add matrix observers, and initialize matrix sessions if the app is not launched in background. @@ -2157,13 +2159,22 @@ - (void)addMatrixSession:(MXSession *)mxSession // register the session to the call service [_callPresenter addMatrixSession:mxSession]; - // Tchap: Disable UISI + // Tchap: try to initialize UISIAutoReporter here + // because we can have a user session at this moment + // and test if the feature is allowed for this user. + MXKAccount *currentAccount = MXKAccountManager.sharedManager.activeAccounts.firstObject; + + if( [currentAccount isFeatureActivated:BuildSettings.tchapFeatureAutoReportUisi] ) + { + self.uisiAutoReporter = [[UISIAutoReporter alloc] init]; + } + // register the session to the uisi auto-reporter -// if (_uisiAutoReporter != nil) -// { -// UISIAutoReporter* uisiAutoReporter = (UISIAutoReporter*)_uisiAutoReporter; -// [uisiAutoReporter add:mxSession]; -// } + if (_uisiAutoReporter != nil) + { + UISIAutoReporter* uisiAutoReporter = (UISIAutoReporter*)_uisiAutoReporter; + [uisiAutoReporter add:mxSession]; + } [mxSessionArray addObject:mxSession]; @@ -2182,12 +2193,11 @@ - (void)removeMatrixSession:(MXSession*)mxSession [_callPresenter removeMatrixSession:mxSession]; // register the session to the uisi auto-reporter - // Tchap: Disable UISI -// if (_uisiAutoReporter != nil) -// { -// UISIAutoReporter* uisiAutoReporter = (UISIAutoReporter*)_uisiAutoReporter; -// [uisiAutoReporter remove:mxSession]; -// } + if (_uisiAutoReporter != nil) + { + UISIAutoReporter* uisiAutoReporter = (UISIAutoReporter*)_uisiAutoReporter; + [uisiAutoReporter remove:mxSession]; + } // Update the widgets manager [[WidgetManager sharedManager] removeMatrixSession:mxSession]; diff --git a/RiotNSE/BuildSettings.swift b/RiotNSE/BuildSettings.swift index 15bd01100..7f9477a0d 100644 --- a/RiotNSE/BuildSettings.swift +++ b/RiotNSE/BuildSettings.swift @@ -221,7 +221,8 @@ final class BuildSettings: NSObject { static let bugReportEndpointUrlSuffix = "/bugreports" // Use the name allocated by the bug report server static let bugReportApplicationId = "tchap-ios" - + static let bugReportUISIId = "element-auto-uisi" + // MARK: - Integrations static let integrationsUiUrlString = "https://scalar.vector.im/" @@ -267,17 +268,21 @@ final class BuildSettings: NSObject { static let tchapFeatureNotificationByEmail = "tchapFeatureNotificationByEmail" static let tchapFeatureVoiceOverIP = "tchapFeatureVoiceOverIP" static let tchapFeatureVideoOverIP = "tchapFeatureVideoOverIP" + static let tchapFeatureAutoReportUisi = "tchapFeatureAutoReportUisi" static var tchapFeaturesAllowedHomeServersForFeature: [String: [String]] = [ tchapFeatureNotificationByEmail: [ "agent.dinum.tchap.gouv.fr" ], tchapFeatureVoiceOverIP: [ "agent.dinum.tchap.gouv.fr" - ] + ], // No activation of video calls actually in Tchap Production. // tchapFeatureVideoOverIP: [ // "agent.dinum.tchap.gouv.fr" // ], + tchapFeatureAutoReportUisi: [ + "agent.dinum.tchap.gouv.fr" + ] ] // MARK: - Side Menu @@ -442,7 +447,7 @@ final class BuildSettings: NSObject { static let secretsRecoveryAllowReset = true // MARK: - UISI Autoreporting - static let cryptoUISIAutoReportingEnabled = false + static let cryptoUISIAutoReportingEnabled = true // Tchap // MARK: - Polls diff --git a/RiotShareExtension/BuildSettings.swift b/RiotShareExtension/BuildSettings.swift index 15bd01100..7f9477a0d 100644 --- a/RiotShareExtension/BuildSettings.swift +++ b/RiotShareExtension/BuildSettings.swift @@ -221,7 +221,8 @@ final class BuildSettings: NSObject { static let bugReportEndpointUrlSuffix = "/bugreports" // Use the name allocated by the bug report server static let bugReportApplicationId = "tchap-ios" - + static let bugReportUISIId = "element-auto-uisi" + // MARK: - Integrations static let integrationsUiUrlString = "https://scalar.vector.im/" @@ -267,17 +268,21 @@ final class BuildSettings: NSObject { static let tchapFeatureNotificationByEmail = "tchapFeatureNotificationByEmail" static let tchapFeatureVoiceOverIP = "tchapFeatureVoiceOverIP" static let tchapFeatureVideoOverIP = "tchapFeatureVideoOverIP" + static let tchapFeatureAutoReportUisi = "tchapFeatureAutoReportUisi" static var tchapFeaturesAllowedHomeServersForFeature: [String: [String]] = [ tchapFeatureNotificationByEmail: [ "agent.dinum.tchap.gouv.fr" ], tchapFeatureVoiceOverIP: [ "agent.dinum.tchap.gouv.fr" - ] + ], // No activation of video calls actually in Tchap Production. // tchapFeatureVideoOverIP: [ // "agent.dinum.tchap.gouv.fr" // ], + tchapFeatureAutoReportUisi: [ + "agent.dinum.tchap.gouv.fr" + ] ] // MARK: - Side Menu @@ -442,7 +447,7 @@ final class BuildSettings: NSObject { static let secretsRecoveryAllowReset = true // MARK: - UISI Autoreporting - static let cryptoUISIAutoReportingEnabled = false + static let cryptoUISIAutoReportingEnabled = true // Tchap // MARK: - Polls diff --git a/Tchap/Config/BuildSettings.swift b/Tchap/Config/BuildSettings.swift index 15bd01100..7f9477a0d 100644 --- a/Tchap/Config/BuildSettings.swift +++ b/Tchap/Config/BuildSettings.swift @@ -221,7 +221,8 @@ final class BuildSettings: NSObject { static let bugReportEndpointUrlSuffix = "/bugreports" // Use the name allocated by the bug report server static let bugReportApplicationId = "tchap-ios" - + static let bugReportUISIId = "element-auto-uisi" + // MARK: - Integrations static let integrationsUiUrlString = "https://scalar.vector.im/" @@ -267,17 +268,21 @@ final class BuildSettings: NSObject { static let tchapFeatureNotificationByEmail = "tchapFeatureNotificationByEmail" static let tchapFeatureVoiceOverIP = "tchapFeatureVoiceOverIP" static let tchapFeatureVideoOverIP = "tchapFeatureVideoOverIP" + static let tchapFeatureAutoReportUisi = "tchapFeatureAutoReportUisi" static var tchapFeaturesAllowedHomeServersForFeature: [String: [String]] = [ tchapFeatureNotificationByEmail: [ "agent.dinum.tchap.gouv.fr" ], tchapFeatureVoiceOverIP: [ "agent.dinum.tchap.gouv.fr" - ] + ], // No activation of video calls actually in Tchap Production. // tchapFeatureVideoOverIP: [ // "agent.dinum.tchap.gouv.fr" // ], + tchapFeatureAutoReportUisi: [ + "agent.dinum.tchap.gouv.fr" + ] ] // MARK: - Side Menu @@ -442,7 +447,7 @@ final class BuildSettings: NSObject { static let secretsRecoveryAllowReset = true // MARK: - UISI Autoreporting - static let cryptoUISIAutoReportingEnabled = false + static let cryptoUISIAutoReportingEnabled = true // Tchap // MARK: - Polls diff --git a/Tchap/target.yml b/Tchap/target.yml index b94a4cfd3..448a265aa 100644 --- a/Tchap/target.yml +++ b/Tchap/target.yml @@ -158,9 +158,9 @@ targetTemplates: - path: ../Riot/Managers/PushNotification - path: ../Riot/Managers/PushRulesUpdater - path: ../Riot/Managers/Serialization - - path: ../Riot/Managers/Settings/RiotSettings.swift - - path: ../Riot/Managers/Settings/Shared + - path: ../Riot/Managers/Settings - path: ../Riot/Managers/Theme + - path: ../Riot/Managers/UISIAutoReporter - path: ../Riot/Managers/URLPreviews - path: ../Riot/Managers/UserSessions - path: ../Riot/Managers/Widgets diff --git a/changelog.d/988.change b/changelog.d/988.change new file mode 100644 index 000000000..73984931c --- /dev/null +++ b/changelog.d/988.change @@ -0,0 +1 @@ +Activation de l'UISIAutoReporter de Element pour envoyer automatiquement un report RageShake en cas de message indéchiffrable \ No newline at end of file