From 4008c43a1b3dfaf922b29370c4a894d2eaf84754 Mon Sep 17 00:00:00 2001 From: Christopher Jr Riley Date: Thu, 25 Apr 2024 18:22:04 -0400 Subject: [PATCH] Tweak definitions to OzoneModerationDefs --- .../Moderation/OzoneModerationDefs.swift | 22 +++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/Sources/ATProtoKit/Models/Lexicons/tools.ozone/Moderation/OzoneModerationDefs.swift b/Sources/ATProtoKit/Models/Lexicons/tools.ozone/Moderation/OzoneModerationDefs.swift index 57514edcdb..d9ce8c7a19 100644 --- a/Sources/ATProtoKit/Models/Lexicons/tools.ozone/Moderation/OzoneModerationDefs.swift +++ b/Sources/ATProtoKit/Models/Lexicons/tools.ozone/Moderation/OzoneModerationDefs.swift @@ -170,6 +170,14 @@ public struct OzoneSubjectStatusView: Codable { /// /// - Note: According to the AT Protocol specifications: "Sticky comment on the subject." @DateFormattingOptional public var muteUntil: Date? = nil + /// The date and time until which reporting on the subject is muted. Optional. + /// + /// - Important: The item associated with this property is undocumented in the AT Protocol specifications. The documentation here is based on:\ + /// \* **For items with some inferable context from property names or references**: its best interpretation, though not with full certainty.\ + /// \* **For items without enough context for even an educated guess**: a direct acknowledgment of their undocumented status.\ + /// \ + /// Clarifications from Bluesky are needed in order to fully understand this item. + @DateFormattingOptional public var muteReportingUntil: Date? /// The name of the reviewer that reviewed the subject. Optional. public var lastReviewedBy: String? = nil /// The date and time the last reviewer looked at the subject. Optional. @@ -188,8 +196,9 @@ public struct OzoneSubjectStatusView: Codable { public var tags: [String]? = nil public init(id: Int, subject: RepositoryReferencesUnion, subjectBlobCIDHashes: [String]?, subjectRepoHandle: String?, updatedAt: Date, createdAt: Date, - reviewState: OzoneSubjectReviewState, comment: String?, muteUntil: Date?, lastReviewedBy: String?, lastReviewedAt: Date?, - lastReportedAt: Date?, lastAppealedAt: Date?, isTakenDown: Bool?, wasAppealed: Bool?, suspendUntil: Date?, tags: [String]?) { + reviewState: OzoneSubjectReviewState, comment: String?, muteUntil: Date?, muteReportingUntil: Date?, lastReviewedBy: String?, + lastReviewedAt: Date?, lastReportedAt: Date?, lastAppealedAt: Date?, isTakenDown: Bool?, wasAppealed: Bool?, suspendUntil: Date?, + tags: [String]?) { self.id = id self.subject = subject self.subjectBlobCIDHashes = subjectBlobCIDHashes @@ -199,6 +208,7 @@ public struct OzoneSubjectStatusView: Codable { self.reviewState = reviewState self.comment = comment self.muteUntil = muteUntil + self._muteReportingUntil = DateFormattingOptional(wrappedValue: muteReportingUntil) self.lastReviewedBy = lastReviewedBy self._lastReviewedAt = DateFormattingOptional(wrappedValue: lastReviewedAt) self._lastReportedAt = DateFormattingOptional(wrappedValue: lastReportedAt) @@ -221,6 +231,7 @@ public struct OzoneSubjectStatusView: Codable { self.reviewState = try container.decode(OzoneSubjectReviewState.self, forKey: .reviewState) self.comment = try container.decodeIfPresent(String.self, forKey: .comment) self.muteUntil = try container.decodeIfPresent(DateFormattingOptional.self, forKey: .muteUntil)?.wrappedValue + self.muteReportingUntil = try container.decodeIfPresent(DateFormattingOptional.self, forKey: .muteReportingUntil)?.wrappedValue self.lastReviewedBy = try container.decodeIfPresent(String.self, forKey: .lastReviewedBy) self.lastReviewedAt = try container.decodeIfPresent(DateFormattingOptional.self, forKey: .lastReviewedAt)?.wrappedValue self.lastReportedAt = try container.decodeIfPresent(DateFormattingOptional.self, forKey: .lastReportedAt)?.wrappedValue @@ -243,6 +254,7 @@ public struct OzoneSubjectStatusView: Codable { try container.encode(self.reviewState, forKey: .reviewState) try container.encodeIfPresent(self.comment, forKey: .comment) try container.encode(self._muteUntil, forKey: .muteUntil) + try container.encodeIfPresent(self._muteReportingUntil, forKey: .muteReportingUntil) try container.encodeIfPresent(self.lastReviewedBy, forKey: .lastReviewedBy) try container.encode(self._lastReviewedAt, forKey: .lastReviewedAt) try container.encode(self._lastReportedAt, forKey: .lastReportedAt) @@ -263,6 +275,7 @@ public struct OzoneSubjectStatusView: Codable { case reviewState case comment case muteUntil + case muteReportingUntil case lastReviewedBy case lastReviewedAt case lastReportedAt @@ -376,6 +389,11 @@ public struct OzoneModerationEventComment: Codable { public struct OzoneModerationEventReport: Codable { /// Any comments for the moderator's report event. Optional. public var comment: String? = nil + /// Indicates whether the reporter has been muted. Optional. + /// + /// - Note: According to the AT Protocol specifications: "Set to true if the reporter was muted from reporting at the time of the event. + /// These reports won't impact the reviewState of the subject." + public let isReporterMuted: Bool? /// The type of report. public let reportType: ModerationReasonType }