From 3f4917931b83b970073e0c65e66b82c688c847c5 Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Mon, 9 Sep 2024 19:13:57 -0400 Subject: [PATCH] Poll own_votes is a nullable array of nullable ints, at least on pleroma I do not understand why Closes #540 --- Packages/Pachyderm/Sources/Pachyderm/Model/Poll.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Packages/Pachyderm/Sources/Pachyderm/Model/Poll.swift b/Packages/Pachyderm/Sources/Pachyderm/Model/Poll.swift index d1c7a663..29d46bd5 100644 --- a/Packages/Pachyderm/Sources/Pachyderm/Model/Poll.swift +++ b/Packages/Pachyderm/Sources/Pachyderm/Model/Poll.swift @@ -16,7 +16,7 @@ public struct Poll: Codable, Sendable { public let votesCount: Int public let votersCount: Int? public let voted: Bool? - public let ownVotes: [Int]? + public let ownVotes: [Int?]? public let options: [Option] public let emojis: [Emoji] @@ -33,7 +33,7 @@ public struct Poll: Codable, Sendable { self.votesCount = try container.decode(Int.self, forKey: .votesCount) self.votersCount = try container.decodeIfPresent(Int.self, forKey: .votersCount) self.voted = try container.decodeIfPresent(Bool.self, forKey: .voted) - self.ownVotes = try container.decodeIfPresent([Int].self, forKey: .ownVotes) + self.ownVotes = try container.decodeIfPresent([Int?].self, forKey: .ownVotes) self.options = try container.decode([Poll.Option].self, forKey: .options) self.emojis = try container.decodeIfPresent([Emoji].self, forKey: .emojis) ?? [] }