-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
/
Copy pathRegistrationCoordinatorDependencies.swift
85 lines (82 loc) · 5.71 KB
/
RegistrationCoordinatorDependencies.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
//
// Copyright 2023 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
//
import Foundation
public import SignalServiceKit
public struct RegistrationCoordinatorDependencies {
public let appExpiry: AppExpiry
public let changeNumberPniManager: ChangePhoneNumberPniManager
public let contactsManager: RegistrationCoordinatorImpl.Shims.ContactsManager
public let contactsStore: RegistrationCoordinatorImpl.Shims.ContactsStore
public let dateProvider: DateProvider
public let db: any DB
public let experienceManager: RegistrationCoordinatorImpl.Shims.ExperienceManager
public let featureFlags: RegistrationCoordinatorImpl.Shims.FeatureFlags
public let accountKeyStore: AccountKeyStore
public let localUsernameManager: LocalUsernameManager
public let messageBackupKeyMaterial: MessageBackupKeyMaterial
public let messageBackupErrorPresenter: MessageBackupErrorPresenter
public let messageBackupManager: MessageBackupManager
public let messagePipelineSupervisor: RegistrationCoordinatorImpl.Shims.MessagePipelineSupervisor
public let messageProcessor: RegistrationCoordinatorImpl.Shims.MessageProcessor
public let ows2FAManager: RegistrationCoordinatorImpl.Shims.OWS2FAManager
public let phoneNumberDiscoverabilityManager: PhoneNumberDiscoverabilityManager
public let pniHelloWorldManager: PniHelloWorldManager
public let preKeyManager: RegistrationCoordinatorImpl.Shims.PreKeyManager
public let profileManager: RegistrationCoordinatorImpl.Shims.ProfileManager
public let pushRegistrationManager: RegistrationCoordinatorImpl.Shims.PushRegistrationManager
public let receiptManager: RegistrationCoordinatorImpl.Shims.ReceiptManager
public let registrationStateChangeManager: RegistrationStateChangeManager
public let schedulers: Schedulers
public let sessionManager: RegistrationSessionManager
public let signalService: OWSSignalServiceProtocol
public let storageServiceRecordIkmCapabilityStore: StorageServiceRecordIkmCapabilityStore
public let storageServiceManager: RegistrationCoordinatorImpl.Shims.StorageServiceManager
public let svr: SecureValueRecovery
public let svrAuthCredentialStore: SVRAuthCredentialStorage
public let tsAccountManager: TSAccountManager
public let udManager: RegistrationCoordinatorImpl.Shims.UDManager
public let usernameApiClient: UsernameApiClient
public let usernameLinkManager: UsernameLinkManager
public static func from(_ object: NSObject) -> RegistrationCoordinatorDependencies {
return RegistrationCoordinatorDependencies(
appExpiry: DependenciesBridge.shared.appExpiry,
changeNumberPniManager: DependenciesBridge.shared.changePhoneNumberPniManager,
contactsManager: RegistrationCoordinatorImpl.Wrappers.ContactsManager(SSKEnvironment.shared.contactManagerImplRef),
contactsStore: RegistrationCoordinatorImpl.Wrappers.ContactsStore(),
dateProvider: { Date() },
db: DependenciesBridge.shared.db,
experienceManager: RegistrationCoordinatorImpl.Wrappers.ExperienceManager(),
featureFlags: RegistrationCoordinatorImpl.Wrappers.FeatureFlags(),
accountKeyStore: DependenciesBridge.shared.accountKeyStore,
localUsernameManager: DependenciesBridge.shared.localUsernameManager,
messageBackupKeyMaterial: DependenciesBridge.shared.messageBackupKeyMaterial,
messageBackupErrorPresenter: DependenciesBridge.shared.messageBackupErrorPresenter,
messageBackupManager: DependenciesBridge.shared.messageBackupManager,
messagePipelineSupervisor: RegistrationCoordinatorImpl.Wrappers.MessagePipelineSupervisor(SSKEnvironment.shared.messagePipelineSupervisorRef),
messageProcessor: RegistrationCoordinatorImpl.Wrappers.MessageProcessor(SSKEnvironment.shared.messageProcessorRef),
ows2FAManager: RegistrationCoordinatorImpl.Wrappers.OWS2FAManager(SSKEnvironment.shared.ows2FAManagerRef),
phoneNumberDiscoverabilityManager: DependenciesBridge.shared.phoneNumberDiscoverabilityManager,
pniHelloWorldManager: DependenciesBridge.shared.pniHelloWorldManager,
preKeyManager: RegistrationCoordinatorImpl.Wrappers.PreKeyManager(
DependenciesBridge.shared.preKeyManager
),
profileManager: RegistrationCoordinatorImpl.Wrappers.ProfileManager(SSKEnvironment.shared.profileManagerRef),
pushRegistrationManager: RegistrationCoordinatorImpl.Wrappers.PushRegistrationManager(AppEnvironment.shared.pushRegistrationManagerRef),
receiptManager: RegistrationCoordinatorImpl.Wrappers.ReceiptManager(SSKEnvironment.shared.receiptManagerRef),
registrationStateChangeManager: DependenciesBridge.shared.registrationStateChangeManager,
schedulers: DependenciesBridge.shared.schedulers,
sessionManager: DependenciesBridge.shared.registrationSessionManager,
signalService: SSKEnvironment.shared.signalServiceRef,
storageServiceRecordIkmCapabilityStore: DependenciesBridge.shared.storageServiceRecordIkmCapabilityStore,
storageServiceManager: RegistrationCoordinatorImpl.Wrappers.StorageServiceManager(SSKEnvironment.shared.storageServiceManagerRef),
svr: DependenciesBridge.shared.svr,
svrAuthCredentialStore: DependenciesBridge.shared.svrCredentialStorage,
tsAccountManager: DependenciesBridge.shared.tsAccountManager,
udManager: RegistrationCoordinatorImpl.Wrappers.UDManager(SSKEnvironment.shared.udManagerRef),
usernameApiClient: DependenciesBridge.shared.usernameApiClient,
usernameLinkManager: DependenciesBridge.shared.usernameLinkManager
)
}
}