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

Add roundURL to GroupChatProcessor.Callback

parent d597352d
No related branches found
No related tags found
2 merge requests!121Update Bindings,!102Release 1.0.0
......@@ -8,13 +8,15 @@ public struct GroupChatProcessor {
msg: Data,
receptionId: Data,
ephemeralId: Int64,
roundId: Int64
roundId: Int64,
roundUrl: String
) {
self.decryptedMessage = decryptedMessage
self.msg = msg
self.receptionId = receptionId
self.ephemeralId = ephemeralId
self.roundId = roundId
self.roundUrl = roundUrl
}
public var decryptedMessage: GroupChatMessage
......@@ -22,6 +24,7 @@ public struct GroupChatProcessor {
public var receptionId: Data
public var ephemeralId: Int64
public var roundId: Int64
public var roundUrl: String
}
public init(
......@@ -58,28 +61,33 @@ extension GroupChatProcessor {
receptionId: Data?,
ephemeralId: Int64,
roundId: Int64,
roundUrl: String?,
err: Error?
) {
if let err = err {
callback.handle(.failure(err as NSError))
return
}
guard let decryptedMessage = decryptedMessage else {
guard let decryptedMessage else {
fatalError("BindingsGroupChatProcessor received `nil` decryptedMessage")
}
guard let msg = msg else {
guard let msg else {
fatalError("BindingsGroupChatProcessor received `nil` msg")
}
guard let receptionId = receptionId else {
guard let receptionId else {
fatalError("BindingsGroupChatProcessor received `nil` receptionId")
}
guard let roundUrl else {
fatalError("BindingsGroupChatProcessor received `nil` roundUrl")
}
do {
callback.handle(.success(.init(
decryptedMessage: try GroupChatMessage.decode(decryptedMessage),
msg: msg,
receptionId: receptionId,
ephemeralId: ephemeralId,
roundId: roundId
roundId: roundId,
roundUrl: roundUrl
)))
} catch {
callback.handle(.failure(error as NSError))
......
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