From 6c1478d9e8cfe103f5b011bf8999b6c30c961b59 Mon Sep 17 00:00:00 2001 From: Dariusz Rybicki <dariusz@elixxir.io> Date: Fri, 7 Oct 2022 13:25:17 +0200 Subject: [PATCH] Add roundURL to GroupChatProcessor.Callback --- .../Callbacks/GroupChatProcessor.swift | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/Sources/XXClient/Callbacks/GroupChatProcessor.swift b/Sources/XXClient/Callbacks/GroupChatProcessor.swift index e6ab9ee4..f303aae4 100644 --- a/Sources/XXClient/Callbacks/GroupChatProcessor.swift +++ b/Sources/XXClient/Callbacks/GroupChatProcessor.swift @@ -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)) -- GitLab