From 885e99a324ccb2ec454f80d290908da1ac7ebc4e Mon Sep 17 00:00:00 2001 From: Nicolas Buquet Date: Wed, 13 Mar 2024 16:50:51 +0100 Subject: [PATCH 1/3] Activation de l'UISIAutoReporter de Element --- Btchap/Config/BuildSettings.swift | 3 ++- DevTchap/Config/BuildSettings.swift | 3 ++- Riot/Modules/Application/LegacyAppDelegate.m | 25 +++++++++----------- RiotNSE/BuildSettings.swift | 3 ++- RiotShareExtension/BuildSettings.swift | 3 ++- Tchap/Config/BuildSettings.swift | 3 ++- Tchap/target.yml | 4 ++-- changelog.d/988.change | 1 + 8 files changed, 24 insertions(+), 21 deletions(-) create mode 100644 changelog.d/988.change diff --git a/Btchap/Config/BuildSettings.swift b/Btchap/Config/BuildSettings.swift index f577db02a..78c266622 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/" diff --git a/DevTchap/Config/BuildSettings.swift b/DevTchap/Config/BuildSettings.swift index 58ee2009f..c92a495a3 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/" diff --git a/Riot/Modules/Application/LegacyAppDelegate.m b/Riot/Modules/Application/LegacyAppDelegate.m index db266e53f..eda1c3522 100644 --- a/Riot/Modules/Application/LegacyAppDelegate.m +++ b/Riot/Modules/Application/LegacyAppDelegate.m @@ -495,8 +495,7 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:( // Tchap: Disable Spaces // self.spaceFeatureUnavailablePresenter = [SpaceFeatureUnavailablePresenter new]; - // Tchap: Disable UISI -// self.uisiAutoReporter = [[UISIAutoReporter alloc] init]; + self.uisiAutoReporter = [[UISIAutoReporter alloc] init]; // Add matrix observers, and initialize matrix sessions if the app is not launched in background. [self initMatrixSessions]; @@ -2157,13 +2156,12 @@ - (void)addMatrixSession:(MXSession *)mxSession // register the session to the call service [_callPresenter addMatrixSession:mxSession]; - // Tchap: Disable UISI // 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 +2180,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..5600fb99e 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/" diff --git a/RiotShareExtension/BuildSettings.swift b/RiotShareExtension/BuildSettings.swift index 15bd01100..5600fb99e 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/" diff --git a/Tchap/Config/BuildSettings.swift b/Tchap/Config/BuildSettings.swift index 15bd01100..5600fb99e 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/" 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 From 762c326ec8d2213cc6396afb7c9f88e34fa07694 Mon Sep 17 00:00:00 2001 From: Nicolas Buquet Date: Thu, 14 Mar 2024 15:33:50 +0100 Subject: [PATCH 2/3] Activation de l'UISIAutoReporter par FeatureFlag --- Btchap/Config/BuildSettings.swift | 1 + DevTchap/Config/BuildSettings.swift | 1 + Riot/Modules/Application/LegacyAppDelegate.m | 15 ++++++++++++++- RiotNSE/BuildSettings.swift | 6 +++++- RiotShareExtension/BuildSettings.swift | 6 +++++- Tchap/Config/BuildSettings.swift | 6 +++++- 6 files changed, 31 insertions(+), 4 deletions(-) diff --git a/Btchap/Config/BuildSettings.swift b/Btchap/Config/BuildSettings.swift index 78c266622..c11cf210c 100644 --- a/Btchap/Config/BuildSettings.swift +++ b/Btchap/Config/BuildSettings.swift @@ -238,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 ] ] diff --git a/DevTchap/Config/BuildSettings.swift b/DevTchap/Config/BuildSettings.swift index c92a495a3..2b4b5375e 100644 --- a/DevTchap/Config/BuildSettings.swift +++ b/DevTchap/Config/BuildSettings.swift @@ -239,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 ] ] diff --git a/Riot/Modules/Application/LegacyAppDelegate.m b/Riot/Modules/Application/LegacyAppDelegate.m index eda1c3522..da8ea0b84 100644 --- a/Riot/Modules/Application/LegacyAppDelegate.m +++ b/Riot/Modules/Application/LegacyAppDelegate.m @@ -495,7 +495,10 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:( // Tchap: Disable Spaces // self.spaceFeatureUnavailablePresenter = [SpaceFeatureUnavailablePresenter new]; - self.uisiAutoReporter = [[UISIAutoReporter alloc] init]; + // 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. [self initMatrixSessions]; @@ -2156,6 +2159,16 @@ - (void)addMatrixSession:(MXSession *)mxSession // register the session to the call service [_callPresenter addMatrixSession:mxSession]; + // 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) { diff --git a/RiotNSE/BuildSettings.swift b/RiotNSE/BuildSettings.swift index 5600fb99e..1d8b8fb48 100644 --- a/RiotNSE/BuildSettings.swift +++ b/RiotNSE/BuildSettings.swift @@ -268,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 diff --git a/RiotShareExtension/BuildSettings.swift b/RiotShareExtension/BuildSettings.swift index 5600fb99e..1d8b8fb48 100644 --- a/RiotShareExtension/BuildSettings.swift +++ b/RiotShareExtension/BuildSettings.swift @@ -268,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 diff --git a/Tchap/Config/BuildSettings.swift b/Tchap/Config/BuildSettings.swift index 5600fb99e..1d8b8fb48 100644 --- a/Tchap/Config/BuildSettings.swift +++ b/Tchap/Config/BuildSettings.swift @@ -268,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 From 47f9641e779951ffd6aee54fc756b065bf1f9040 Mon Sep 17 00:00:00 2001 From: Nicolas Buquet Date: Wed, 20 Mar 2024 11:27:56 +0100 Subject: [PATCH 3/3] =?UTF-8?q?Activation=20par=20d=C3=A9faut=20de=20l'UIS?= =?UTF-8?q?IAutoReporter?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Btchap/Config/BuildSettings.swift | 2 +- Config/BuildSettings.swift | 2 +- DevTchap/Config/BuildSettings.swift | 2 +- RiotNSE/BuildSettings.swift | 2 +- RiotShareExtension/BuildSettings.swift | 2 +- Tchap/Config/BuildSettings.swift | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Btchap/Config/BuildSettings.swift b/Btchap/Config/BuildSettings.swift index c11cf210c..f3e2788fb 100644 --- a/Btchap/Config/BuildSettings.swift +++ b/Btchap/Config/BuildSettings.swift @@ -405,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 2b4b5375e..824aed507 100644 --- a/DevTchap/Config/BuildSettings.swift +++ b/DevTchap/Config/BuildSettings.swift @@ -406,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/RiotNSE/BuildSettings.swift b/RiotNSE/BuildSettings.swift index 1d8b8fb48..7f9477a0d 100644 --- a/RiotNSE/BuildSettings.swift +++ b/RiotNSE/BuildSettings.swift @@ -447,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 1d8b8fb48..7f9477a0d 100644 --- a/RiotShareExtension/BuildSettings.swift +++ b/RiotShareExtension/BuildSettings.swift @@ -447,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 1d8b8fb48..7f9477a0d 100644 --- a/Tchap/Config/BuildSettings.swift +++ b/Tchap/Config/BuildSettings.swift @@ -447,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