Skip to content
Snippets Groups Projects
Commit 6c9b2866 authored by Dariusz Rybicki's avatar Dariusz Rybicki
Browse files

Use Contact model in CMixConnect

parent 8b2e35cb
No related branches found
No related tags found
2 merge requests!102Release 1.0.0,!42Update Bindings
...@@ -2,31 +2,31 @@ import Bindings ...@@ -2,31 +2,31 @@ import Bindings
import XCTestDynamicOverlay import XCTestDynamicOverlay
public struct CMixConnect { public struct CMixConnect {
public var run: (Bool, Int, Data, Data) throws -> Connection public var run: (Bool, Int, Contact, Data) throws -> Connection
public func callAsFunction( public func callAsFunction(
withAuthentication: Bool, withAuthentication: Bool,
e2eId: Int, e2eId: Int,
recipientContact: Data, recipient: Contact,
e2eParamsJSON: Data = GetE2EParams.liveDefault() e2eParamsJSON: Data = GetE2EParams.liveDefault()
) throws -> Connection { ) throws -> Connection {
try run(withAuthentication, e2eId, recipientContact, e2eParamsJSON) try run(withAuthentication, e2eId, recipient, e2eParamsJSON)
} }
} }
extension CMixConnect { extension CMixConnect {
public static func live(_ bindingsCMix: BindingsCmix) -> CMixConnect { public static func live(_ bindingsCMix: BindingsCmix) -> CMixConnect {
CMixConnect { withAuthentication, e2eId, recipientContact, e2eParamsJSON in CMixConnect { withAuthentication, e2eId, recipient, e2eParamsJSON in
if withAuthentication { if withAuthentication {
return .live(try bindingsCMix.connect( return .live(try bindingsCMix.connect(
withAuthentication: e2eId, withAuthentication: e2eId,
recipientContact: recipientContact, recipientContact: recipient.data,
e2eParamsJSON: e2eParamsJSON e2eParamsJSON: e2eParamsJSON
)) ))
} else { } else {
return .live(try bindingsCMix.connect( return .live(try bindingsCMix.connect(
e2eId, e2eId,
recipientContact: recipientContact, recipientContact: recipient.data,
e2eParamsJSON: e2eParamsJSON e2eParamsJSON: e2eParamsJSON
)) ))
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment