You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
import SessionMessagingKit
|
|
|
|
import SessionSnodeKit
|
|
|
|
|
|
|
|
extension OWSPrimaryStorage : OWSPrimaryStorageProtocol { }
|
|
|
|
|
|
|
|
var isSetup: Bool = false // TODO: Remove this
|
|
|
|
|
|
|
|
@objc(SNConfiguration)
|
|
|
|
public final class Configuration : NSObject {
|
|
|
|
|
|
|
|
|
|
|
|
@objc public static func performMainSetup() {
|
|
|
|
// Need to do this first to ensure the legacy database exists
|
|
|
|
SNUtilitiesKit.configure(
|
|
|
|
owsPrimaryStorage: OWSPrimaryStorage.shared(),
|
|
|
|
maxFileSize: UInt(Double(FileServerAPIV2.maxFileSize) / FileServerAPIV2.fileSizeORMultiplier)
|
|
|
|
)
|
|
|
|
|
|
|
|
if !isSetup {
|
|
|
|
isSetup = true
|
|
|
|
|
|
|
|
// TODO: Need to store this result somewhere?
|
|
|
|
// TODO: This function seems to get called multiple times
|
|
|
|
//DispatchQueue.main.once
|
|
|
|
let storage: GRDBStorage? = try? GRDBStorage(
|
|
|
|
migrations: [
|
|
|
|
SNUtilitiesKit.migrations(),
|
|
|
|
SNSnodeKit.migrations(),
|
|
|
|
SNMessagingKit.migrations()
|
|
|
|
]
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
SNMessagingKit.configure(storage: Storage.shared)
|
|
|
|
SNSnodeKit.configure()
|
|
|
|
}
|
|
|
|
}
|