|
|
@ -16,6 +16,11 @@ import SignalMessaging
|
|
|
|
return _shared
|
|
|
|
return _shared
|
|
|
|
}
|
|
|
|
}
|
|
|
|
set {
|
|
|
|
set {
|
|
|
|
|
|
|
|
guard CurrentAppContext().isRunningTests else {
|
|
|
|
|
|
|
|
owsFailDebug("Can only switch environments in tests.")
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
_shared = newValue
|
|
|
|
_shared = newValue
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -41,6 +46,9 @@ import SignalMessaging
|
|
|
|
@objc
|
|
|
|
@objc
|
|
|
|
public var callNotificationsAdapter: CallNotificationsAdapter
|
|
|
|
public var callNotificationsAdapter: CallNotificationsAdapter
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@objc
|
|
|
|
|
|
|
|
public var pushRegistrationManager: PushRegistrationManager
|
|
|
|
|
|
|
|
|
|
|
|
@objc
|
|
|
|
@objc
|
|
|
|
public init(callMessageHandler: WebRTCCallMessageHandler,
|
|
|
|
public init(callMessageHandler: WebRTCCallMessageHandler,
|
|
|
|
callService: CallService,
|
|
|
|
callService: CallService,
|
|
|
@ -48,7 +56,8 @@ import SignalMessaging
|
|
|
|
messageFetcherJob: MessageFetcherJob,
|
|
|
|
messageFetcherJob: MessageFetcherJob,
|
|
|
|
notificationsManager: NotificationsManager,
|
|
|
|
notificationsManager: NotificationsManager,
|
|
|
|
accountManager: AccountManager,
|
|
|
|
accountManager: AccountManager,
|
|
|
|
callNotificationsAdapter : CallNotificationsAdapter) {
|
|
|
|
callNotificationsAdapter: CallNotificationsAdapter,
|
|
|
|
|
|
|
|
pushRegistrationManager: PushRegistrationManager) {
|
|
|
|
self.callMessageHandler = callMessageHandler
|
|
|
|
self.callMessageHandler = callMessageHandler
|
|
|
|
self.callService = callService
|
|
|
|
self.callService = callService
|
|
|
|
self.outboundCallInitiator = outboundCallInitiator
|
|
|
|
self.outboundCallInitiator = outboundCallInitiator
|
|
|
@ -56,13 +65,11 @@ import SignalMessaging
|
|
|
|
self.notificationsManager = notificationsManager
|
|
|
|
self.notificationsManager = notificationsManager
|
|
|
|
self.accountManager = accountManager
|
|
|
|
self.accountManager = accountManager
|
|
|
|
self.callNotificationsAdapter = callNotificationsAdapter
|
|
|
|
self.callNotificationsAdapter = callNotificationsAdapter
|
|
|
|
|
|
|
|
self.pushRegistrationManager = pushRegistrationManager
|
|
|
|
|
|
|
|
|
|
|
|
super
|
|
|
|
super.init()
|
|
|
|
.init()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SwiftSingletons.register(self)
|
|
|
|
SwiftSingletons.register(self)
|
|
|
|
|
|
|
|
|
|
|
|
setup()
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private override init() {
|
|
|
|
private override init() {
|
|
|
@ -73,6 +80,7 @@ import SignalMessaging
|
|
|
|
let callMessageHandler = WebRTCCallMessageHandler()
|
|
|
|
let callMessageHandler = WebRTCCallMessageHandler()
|
|
|
|
let outboundCallInitiator = OutboundCallInitiator()
|
|
|
|
let outboundCallInitiator = OutboundCallInitiator()
|
|
|
|
let messageFetcherJob = MessageFetcherJob()
|
|
|
|
let messageFetcherJob = MessageFetcherJob()
|
|
|
|
|
|
|
|
let pushRegistrationManager = PushRegistrationManager()
|
|
|
|
|
|
|
|
|
|
|
|
self.callMessageHandler = callMessageHandler
|
|
|
|
self.callMessageHandler = callMessageHandler
|
|
|
|
self.callService = callService
|
|
|
|
self.callService = callService
|
|
|
@ -81,15 +89,15 @@ import SignalMessaging
|
|
|
|
self.notificationsManager = notificationsManager
|
|
|
|
self.notificationsManager = notificationsManager
|
|
|
|
self.accountManager = accountManager
|
|
|
|
self.accountManager = accountManager
|
|
|
|
self.callNotificationsAdapter = callNotificationsAdapter
|
|
|
|
self.callNotificationsAdapter = callNotificationsAdapter
|
|
|
|
|
|
|
|
self.pushRegistrationManager = pushRegistrationManager
|
|
|
|
|
|
|
|
|
|
|
|
super.init()
|
|
|
|
super.init()
|
|
|
|
|
|
|
|
|
|
|
|
SwiftSingletons.register(self)
|
|
|
|
SwiftSingletons.register(self)
|
|
|
|
|
|
|
|
|
|
|
|
setup()
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private func setup() {
|
|
|
|
@objc
|
|
|
|
|
|
|
|
public func setup() {
|
|
|
|
callService.createCallUIAdapter()
|
|
|
|
callService.createCallUIAdapter()
|
|
|
|
|
|
|
|
|
|
|
|
// Hang certain singletons on SSKEnvironment too.
|
|
|
|
// Hang certain singletons on SSKEnvironment too.
|
|
|
|