mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
crypto: Add configuration flag to enable invisible crypto (#3247)
This commit is contained in:
@@ -32,7 +32,7 @@ import UserNotifications
|
||||
// We keep a global `environment` singleton to ensure that our app context,
|
||||
// database, logging, etc. are only ever setup once per *process*
|
||||
|
||||
private let settings: NSESettingsProtocol = AppSettings()
|
||||
private let settings: CommonSettingsProtocol = AppSettings()
|
||||
private let notificationContentBuilder = NotificationContentBuilder(messageEventStringBuilder: RoomMessageEventStringBuilder(attributedStringBuilder: AttributedStringBuilder(mentionBuilder: PlainMentionBuilder()), prefix: .none))
|
||||
private let keychainController = KeychainController(service: .sessions,
|
||||
accessGroup: InfoPlistReader.main.keychainAccessGroupIdentifier)
|
||||
@@ -81,7 +81,8 @@ class NotificationServiceExtension: UNNotificationServiceExtension {
|
||||
do {
|
||||
Self.userSession = try await NSEUserSession(credentials: credentials,
|
||||
clientSessionDelegate: keychainController,
|
||||
appHooks: appHooks)
|
||||
appHooks: appHooks,
|
||||
appSettings: settings)
|
||||
} catch {
|
||||
MXLog.error("Failed creating user session with error: \(error)")
|
||||
}
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
//
|
||||
// Copyright 2023, 2024 New Vector Ltd.
|
||||
//
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
// Please see LICENSE in the repository root for full details.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
protocol NSESettingsProtocol {
|
||||
var logLevel: TracingConfiguration.LogLevel { get }
|
||||
}
|
||||
|
||||
extension AppSettings: NSESettingsProtocol { }
|
||||
@@ -19,7 +19,7 @@ final class NSEUserSession {
|
||||
networkMonitor: nil)
|
||||
private let delegateHandle: TaskHandle?
|
||||
|
||||
init(credentials: KeychainCredentials, clientSessionDelegate: ClientSessionDelegate, appHooks: AppHooks) async throws {
|
||||
init(credentials: KeychainCredentials, clientSessionDelegate: ClientSessionDelegate, appHooks: AppHooks, appSettings: CommonSettingsProtocol) async throws {
|
||||
sessionDirectories = credentials.restorationToken.sessionDirectories
|
||||
|
||||
userID = credentials.userID
|
||||
@@ -33,7 +33,8 @@ final class NSEUserSession {
|
||||
httpProxy: URL(string: homeserverURL)?.globalProxy,
|
||||
slidingSync: .restored,
|
||||
sessionDelegate: clientSessionDelegate,
|
||||
appHooks: appHooks)
|
||||
appHooks: appHooks,
|
||||
invisibleCryptoEnabled: appSettings.invisibleCryptoEnabled)
|
||||
.sessionPaths(dataPath: credentials.restorationToken.sessionDirectories.dataPath,
|
||||
cachePath: credentials.restorationToken.sessionDirectories.cachePath)
|
||||
.username(username: credentials.userID)
|
||||
|
||||
Reference in New Issue
Block a user