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
import XCTestDynamicOverlay
public struct CMixConnect {
public var run: (Bool, Int, Data, Data) throws -> Connection
public var run: (Bool, Int, Contact, Data) throws -> Connection
public func callAsFunction(
withAuthentication: Bool,
e2eId: Int,
recipientContact: Data,
recipient: Contact,
e2eParamsJSON: Data = GetE2EParams.liveDefault()
) throws -> Connection {
try run(withAuthentication, e2eId, recipientContact, e2eParamsJSON)
try run(withAuthentication, e2eId, recipient, e2eParamsJSON)
}
}
extension CMixConnect {
public static func live(_ bindingsCMix: BindingsCmix) -> CMixConnect {
CMixConnect { withAuthentication, e2eId, recipientContact, e2eParamsJSON in
CMixConnect { withAuthentication, e2eId, recipient, e2eParamsJSON in
if withAuthentication {
return .live(try bindingsCMix.connect(
withAuthentication: e2eId,
recipientContact: recipientContact,
recipientContact: recipient.data,
e2eParamsJSON: e2eParamsJSON
))
} else {
return .live(try bindingsCMix.connect(
e2eId,
recipientContact: recipientContact,
recipientContact: recipient.data,
e2eParamsJSON: e2eParamsJSON
))
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment