mirror of
https://github.com/oxen-io/session-ios.git
synced 2023-12-13 21:30:14 +01:00
Moved the JobRunner into SessionUtilitiesKit so it can be used by SessionSnodeKit Exposed a 'sharedLokiProject' value on UserDefaults to remove the hard-coded group name used everywhere Added "blocking" job support for 'OnLaunch' and 'OnActive' jobs to the JobRunner (will retry until it succeeds) Added the UpdateProfilePicture and RetrieveDefaultOpenGroupRooms jobs
36 lines
1.3 KiB
Swift
36 lines
1.3 KiB
Swift
|
|
@objc
|
|
public final class SNUtilitiesKitConfiguration : NSObject {
|
|
@objc public let owsPrimaryStorage: OWSPrimaryStorageProtocol
|
|
public let maxFileSize: UInt
|
|
|
|
@objc public static var shared: SNUtilitiesKitConfiguration!
|
|
|
|
fileprivate init(owsPrimaryStorage: OWSPrimaryStorageProtocol, maxFileSize: UInt) {
|
|
self.owsPrimaryStorage = owsPrimaryStorage
|
|
self.maxFileSize = maxFileSize
|
|
}
|
|
}
|
|
|
|
public enum SNUtilitiesKit { // Just to make the external API nice
|
|
public static func migrations() -> TargetMigrations {
|
|
return TargetMigrations(
|
|
identifier: .utilitiesKit,
|
|
migrations: [
|
|
[
|
|
// Intentionally including the '_003_YDBToGRDBMigration' in the first migration
|
|
// set to ensure the 'Identity' data is migrated before any other migrations are
|
|
// run (some need access to the users publicKey)
|
|
_001_InitialSetupMigration.self,
|
|
_002_SetupStandardJobs.self,
|
|
_003_YDBToGRDBMigration.self
|
|
]
|
|
]
|
|
)
|
|
}
|
|
|
|
public static func configure(owsPrimaryStorage: OWSPrimaryStorageProtocol, maxFileSize: UInt) {
|
|
SNUtilitiesKitConfiguration.shared = SNUtilitiesKitConfiguration(owsPrimaryStorage: owsPrimaryStorage, maxFileSize: maxFileSize)
|
|
}
|
|
}
|