mirror of
https://github.com/lux-tel/session-ios.git
synced 2026-10-30 20:38:32 +00:00
Got a number of the GroupUpdate messages working properly Updated the DisplayPictureDownloadJob to support OpenGroup room images Updated the Poller to process messages by namespace (sorted) and added support for synchronous handling of messages Reworked the ProfileManager to be a more reusable DisplayPictureManager Cleaned up the conversion from milliseconds to TimeInterval (which is documented as seconds) for clarity Fixed a read/write crash due to the SnodeAPI cache setup Fixed an issue where dependencies could incorrectly overwrite each other when based on protocols
38 lines
968 B
Swift
38 lines
968 B
Swift
// Copyright © 2023 Rangeproof Pty Ltd. All rights reserved.
|
|
|
|
import Foundation
|
|
|
|
// MARK: - UserDefaultsStorage
|
|
|
|
public class UserDefaultsStorage {}
|
|
|
|
// MARK: - UserDefaultsConfig
|
|
|
|
public class UserDefaultsConfig: UserDefaultsStorage {
|
|
public let identifier: String
|
|
public let createInstance: (Dependencies) -> UserDefaultsType
|
|
|
|
/// `fileprivate` to hide when accessing via `dependencies[defaults: ]`
|
|
fileprivate init(
|
|
identifier: String,
|
|
createInstance: @escaping (Dependencies) -> UserDefaultsType
|
|
) {
|
|
self.identifier = identifier
|
|
self.createInstance = createInstance
|
|
}
|
|
}
|
|
|
|
// MARK: - Creation
|
|
|
|
public extension Dependencies {
|
|
static func create(
|
|
identifier: String,
|
|
createInstance: @escaping (Dependencies) -> UserDefaultsType
|
|
) -> UserDefaultsConfig {
|
|
return UserDefaultsConfig(
|
|
identifier: identifier,
|
|
createInstance: createInstance
|
|
)
|
|
}
|
|
}
|