mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 16:10:20 +00:00
Introduce a feature flag for the new identity pinning violation notifications feature.
This commit is contained in:
committed by
Stefan Ceriu
parent
13bc3a1dd4
commit
4d697a3a49
@@ -46,6 +46,7 @@ final class AppSettings {
|
|||||||
case fuzzyRoomListSearchEnabled
|
case fuzzyRoomListSearchEnabled
|
||||||
case pinningEnabled
|
case pinningEnabled
|
||||||
case enableOnlySignedDeviceIsolationMode
|
case enableOnlySignedDeviceIsolationMode
|
||||||
|
case identityPinningViolationNotificationsEnabled
|
||||||
}
|
}
|
||||||
|
|
||||||
private static var suiteName: String = InfoPlistReader.main.appGroupIdentifier
|
private static var suiteName: String = InfoPlistReader.main.appGroupIdentifier
|
||||||
@@ -278,6 +279,9 @@ final class AppSettings {
|
|||||||
enum SlidingSyncDiscovery: Codable { case proxy, native, forceNative }
|
enum SlidingSyncDiscovery: Codable { case proxy, native, forceNative }
|
||||||
@UserPreference(key: UserDefaultsKeys.slidingSyncDiscovery, defaultValue: .native, storageType: .userDefaults(store))
|
@UserPreference(key: UserDefaultsKeys.slidingSyncDiscovery, defaultValue: .native, storageType: .userDefaults(store))
|
||||||
var slidingSyncDiscovery: SlidingSyncDiscovery
|
var slidingSyncDiscovery: SlidingSyncDiscovery
|
||||||
|
|
||||||
|
@UserPreference(key: UserDefaultsKeys.identityPinningViolationNotificationsEnabled, defaultValue: isDevelopmentBuild, storageType: .userDefaults(store))
|
||||||
|
var identityPinningViolationNotificationsEnabled
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -142,7 +142,9 @@ class RoomScreenViewModel: RoomScreenViewModelType, RoomScreenViewModelProtocol
|
|||||||
}
|
}
|
||||||
.store(in: &cancellables)
|
.store(in: &cancellables)
|
||||||
|
|
||||||
let identityStatusChangesPublisher = roomProxy.identityStatusChangesPublisher.receive(on: DispatchQueue.main)
|
let identityStatusChangesPublisher = roomProxy.identityStatusChangesPublisher
|
||||||
|
.receive(on: DispatchQueue.main)
|
||||||
|
.filter { [weak self] _ in self?.appSettings.identityPinningViolationNotificationsEnabled ?? false }
|
||||||
|
|
||||||
Task { [weak self] in
|
Task { [weak self] in
|
||||||
for await changes in identityStatusChangesPublisher.values {
|
for await changes in identityStatusChangesPublisher.values {
|
||||||
|
|||||||
+1
@@ -48,6 +48,7 @@ protocol DeveloperOptionsProtocol: AnyObject {
|
|||||||
var hideTimelineMedia: Bool { get set }
|
var hideTimelineMedia: Bool { get set }
|
||||||
var enableOnlySignedDeviceIsolationMode: Bool { get set }
|
var enableOnlySignedDeviceIsolationMode: Bool { get set }
|
||||||
var elementCallBaseURLOverride: URL? { get set }
|
var elementCallBaseURLOverride: URL? { get set }
|
||||||
|
var identityPinningViolationNotificationsEnabled: Bool { get set }
|
||||||
}
|
}
|
||||||
|
|
||||||
extension AppSettings: DeveloperOptionsProtocol { }
|
extension AppSettings: DeveloperOptionsProtocol { }
|
||||||
|
|||||||
+4
@@ -49,6 +49,10 @@ struct DeveloperOptionsScreen: View {
|
|||||||
Toggle(isOn: $context.hideTimelineMedia) {
|
Toggle(isOn: $context.hideTimelineMedia) {
|
||||||
Text("Hide image & video previews")
|
Text("Hide image & video previews")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Toggle(isOn: $context.identityPinningViolationNotificationsEnabled) {
|
||||||
|
Text("Identity pinning violation notifications")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Section {
|
Section {
|
||||||
|
|||||||
Reference in New Issue
Block a user