Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Activation de l'UISIAutoReporter de Element #990

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Btchap/Config/BuildSettings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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/"
Expand Down Expand Up @@ -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 ]
]
Expand Down
4 changes: 3 additions & 1 deletion DevTchap/Config/BuildSettings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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/"
Expand Down Expand Up @@ -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 ]
]
Expand Down
36 changes: 23 additions & 13 deletions Riot/Modules/Application/LegacyAppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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];

Expand All @@ -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];
Expand Down
9 changes: 7 additions & 2 deletions RiotNSE/BuildSettings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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/"
Expand Down Expand Up @@ -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
Expand Down
9 changes: 7 additions & 2 deletions RiotShareExtension/BuildSettings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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/"
Expand Down Expand Up @@ -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
Expand Down
9 changes: 7 additions & 2 deletions Tchap/Config/BuildSettings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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/"
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions Tchap/target.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions changelog.d/988.change
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Activation de l'UISIAutoReporter de Element pour envoyer automatiquement un report RageShake en cas de message indéchiffrable
Loading