mirror of https://github.com/oxen-io/session-ios
Various dependency changes required to get unit tests working correctly
• Updated the SessionCallManager to be an updated singleton type (cleaned up more in Groups Rebuild) • Updated the PushRegistrationManager to be an updated singleton type (cleaned up more in Groups Rebuild) • Injected dependencies correctly in a bunch of placespull/1053/head
parent
2ee1fa0125
commit
e1c5215986
@ -0,0 +1,29 @@
|
||||
// Copyright © 2024 Rangeproof Pty Ltd. All rights reserved.
|
||||
|
||||
import Foundation
|
||||
import Combine
|
||||
|
||||
// FIXME: Remove this in Groups Rebuild (redundant with the updated dependency management)
|
||||
public protocol PushRegistrationManagerType {
|
||||
func createVoipRegistryIfNecessary()
|
||||
func didReceiveVanillaPushToken(_ tokenData: Data)
|
||||
func didFailToReceiveVanillaPushToken(error: Error)
|
||||
|
||||
func requestPushTokens() -> AnyPublisher<(pushToken: String, voipToken: String), Error>
|
||||
}
|
||||
|
||||
// MARK: - NoopPushRegistrationManager
|
||||
|
||||
public class NoopPushRegistrationManager: PushRegistrationManagerType {
|
||||
public func createVoipRegistryIfNecessary() {}
|
||||
public func didReceiveVanillaPushToken(_ tokenData: Data) {}
|
||||
public func didFailToReceiveVanillaPushToken(error: Error) {}
|
||||
|
||||
public func requestPushTokens() -> AnyPublisher<(pushToken: String, voipToken: String), Error> {
|
||||
return Fail(
|
||||
error: PushRegistrationError.assertionError(
|
||||
description: "Attempted to register with NoopPushRegistrationManager" // stringlint:ignore
|
||||
)
|
||||
).eraseToAnyPublisher()
|
||||
}
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
// Copyright © 2024 Rangeproof Pty Ltd. All rights reserved.
|
||||
|
||||
import Foundation
|
||||
import CallKit
|
||||
|
||||
internal struct NoopSessionCallManager: CallManagerProtocol {
|
||||
var currentCall: CurrentCallProtocol?
|
||||
|
||||
func setCurrentCall(_ call: CurrentCallProtocol?) {}
|
||||
func reportIncomingCall(_ call: CurrentCallProtocol, callerName: String, completion: @escaping (Error?) -> Void) {}
|
||||
func reportCurrentCallEnded(reason: CXCallEndedReason?) {}
|
||||
func suspendDatabaseIfCallEndedInBackground() {}
|
||||
|
||||
func startCall(_ call: CurrentCallProtocol?, completion: ((Error?) -> Void)?) {}
|
||||
func answerCall(_ call: CurrentCallProtocol?, completion: ((Error?) -> Void)?) {}
|
||||
func endCall(_ call: CurrentCallProtocol?, completion: ((Error?) -> Void)?) {}
|
||||
|
||||
func showCallUIForCall(caller: String, uuid: String, mode: CallMode, interactionId: Int64?) {}
|
||||
func handleICECandidates(message: CallMessage, sdpMLineIndexes: [UInt32], sdpMids: [String]) {}
|
||||
func handleAnswerMessage(_ message: CallMessage) {}
|
||||
|
||||
func currentWebRTCSessionMatches(callId: String) -> Bool { return false }
|
||||
|
||||
func dismissAllCallUI() {}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue