diff --git a/Sources/XXClient/Models/SingleUseSendReport.swift b/Sources/XXClient/Models/SingleUseSendReport.swift index affd341d2ae8d236d529b090bbccaf52418f6318..870e73e2f99398e1bf58a1083c0fc9d02fac61fd 100644 --- a/Sources/XXClient/Models/SingleUseSendReport.swift +++ b/Sources/XXClient/Models/SingleUseSendReport.swift @@ -3,15 +3,18 @@ import Foundation public struct SingleUseSendReport: Equatable { public init( rounds: [Int], + roundURL: String, ephId: Int64, receptionId: Data ) { self.rounds = rounds + self.roundURL = roundURL self.ephId = ephId self.receptionId = receptionId } public var rounds: [Int] + public var roundURL: String public var ephId: Int64 public var receptionId: Data } @@ -19,6 +22,7 @@ public struct SingleUseSendReport: Equatable { extension SingleUseSendReport: Codable { enum CodingKeys: String, CodingKey { case rounds = "Rounds" + case roundURL = "RoundURL" case ephId = "EphID" case receptionId = "ReceptionID" } diff --git a/Tests/XXClientTests/Models/SingleUseSendReportTests.swift b/Tests/XXClientTests/Models/SingleUseSendReportTests.swift index 07a836d9cf10f43ddfe4a9b445dd3870aac39253..db25f50e3d4e7d7bd10b53e545d164e5c0ba54ac 100644 --- a/Tests/XXClientTests/Models/SingleUseSendReportTests.swift +++ b/Tests/XXClientTests/Models/SingleUseSendReportTests.swift @@ -5,11 +5,13 @@ import XCTest final class SingleUseSendReportTests: XCTestCase { func testCoding() throws { let rounds: [Int] = [1, 5, 9] + let roundURL = "https://dashboard.xx.network/rounds/25?xxmessenger=true" let ephId: Int64 = 1_655_533 let receptionIdB64 = "emV6aW1hAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD" let jsonString = """ { "Rounds": [\(rounds.map { "\($0)" }.joined(separator: ", "))], + "RoundURL": "\(roundURL)", "EphID": \(ephId), "ReceptionID": "\(receptionIdB64)" } @@ -19,6 +21,7 @@ final class SingleUseSendReportTests: XCTestCase { XCTAssertNoDifference(model, SingleUseSendReport( rounds: rounds, + roundURL: roundURL, ephId: ephId, receptionId: Data(base64Encoded: receptionIdB64)! )) diff --git a/Tests/XXMessengerClientTests/Messenger/Functions/MessengerSearchUsersTests.swift b/Tests/XXMessengerClientTests/Messenger/Functions/MessengerSearchUsersTests.swift index 9ffa1c82bdc0fec3fc7b089c2ef25a60f634d86d..21152086ca38c771ae678109a4545be1232c5b9f 100644 --- a/Tests/XXMessengerClientTests/Messenger/Functions/MessengerSearchUsersTests.swift +++ b/Tests/XXMessengerClientTests/Messenger/Functions/MessengerSearchUsersTests.swift @@ -38,7 +38,7 @@ final class MessengerSearchUsersTests: XCTestCase { .unimplemented("contact-2".data(using: .utf8)!), .unimplemented("contact-3".data(using: .utf8)!), ])) - return SingleUseSendReport(rounds: [], ephId: 0, receptionId: Data()) + return SingleUseSendReport(rounds: [], roundURL: "", ephId: 0, receptionId: Data()) } let search: MessengerSearchUsers = .live(env) @@ -128,7 +128,7 @@ final class MessengerSearchUsersTests: XCTestCase { env.getSingleUseParams.run = { Data() } env.searchUD.run = { _, _, _, _, callback in callback.handle(.failure(error as NSError)) - return SingleUseSendReport(rounds: [], ephId: 0, receptionId: Data()) + return SingleUseSendReport(rounds: [], roundURL: "", ephId: 0, receptionId: Data()) } let search: MessengerSearchUsers = .live(env)