Skip to content

Commit 3fed5a1

Browse files
authored
Merge pull request #221 from mcprostar205/main
2 parents 5b9ce14 + 47aede4 commit 3fed5a1

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

Sources/ATProtoKit/Models/Lexicons/app.bsky/Actor/AppBskyActorDefs.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1659,32 +1659,32 @@ extension AppBskyLexicon.Actor {
16591659
/// - Note: According to the AT Protocol specifications: "Matches threadgate record. List of rules
16601660
/// defining who can reply to this users posts. If value is an empty array, no one can reply. If
16611661
/// value is undefined, anyone can reply."
1662-
public let threadgateAllowRules: [ThreadgateAllowRulesUnion]
1662+
public let threadgateAllowRules: [ThreadgateAllowRulesUnion]?
16631663

16641664
/// An array of rules that determines the default settings for determining who can embed the post.
16651665
///
16661666
/// - Note: According to the AT Protocol specifications: "Matches postgate record. List of rules
16671667
/// defining who can embed this users posts. If value is an empty array or is undefined, no
16681668
/// particular rules apply and anyone can embed."
1669-
public let postgateEmbeddingRules: [PostgateEmbeddingRulesUnion]
1669+
public let postgateEmbeddingRules: [PostgateEmbeddingRulesUnion]?
16701670

1671-
public init(threadgateAllowRules: [ThreadgateAllowRulesUnion], postgateEmbeddingRules: [PostgateEmbeddingRulesUnion]) {
1671+
public init(threadgateAllowRules: [ThreadgateAllowRulesUnion]? = nil, postgateEmbeddingRules: [PostgateEmbeddingRulesUnion]? = nil) {
16721672
self.threadgateAllowRules = threadgateAllowRules
16731673
self.postgateEmbeddingRules = postgateEmbeddingRules
16741674
}
16751675

16761676
public init(from decoder: any Decoder) throws {
16771677
let container = try decoder.container(keyedBy: CodingKeys.self)
16781678

1679-
self.threadgateAllowRules = try container.decode([ThreadgateAllowRulesUnion].self, forKey: .threadgateAllowRules)
1680-
self.postgateEmbeddingRules = try container.decode([PostgateEmbeddingRulesUnion].self, forKey: .postgateEmbeddingRules)
1679+
self.threadgateAllowRules = try container.decodeIfPresent([ThreadgateAllowRulesUnion].self, forKey: .threadgateAllowRules)
1680+
self.postgateEmbeddingRules = try container.decodeIfPresent([PostgateEmbeddingRulesUnion].self, forKey: .postgateEmbeddingRules)
16811681
}
16821682

16831683
public func encode(to encoder: any Encoder) throws {
16841684
var container = encoder.container(keyedBy: CodingKeys.self)
16851685

1686-
try container.truncatedEncode(self.threadgateAllowRules, forKey: .threadgateAllowRules, upToArrayLength: 5)
1687-
try container.truncatedEncode(self.postgateEmbeddingRules, forKey: .postgateEmbeddingRules, upToArrayLength: 5)
1686+
try container.truncatedEncodeIfPresent(self.threadgateAllowRules, forKey: .threadgateAllowRules, upToArrayLength: 5)
1687+
try container.truncatedEncodeIfPresent(self.postgateEmbeddingRules, forKey: .postgateEmbeddingRules, upToArrayLength: 5)
16881688
}
16891689

16901690
enum CodingKeys: String, CodingKey {

Sources/ATProtoKit/Models/Lexicons/app.bsky/Notification/AppBskyNotificationListNotifications.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ extension AppBskyLexicon.Notification {
159159

160160
// Enums
161161
/// The kind of notification received.
162-
public enum Reason: Sendable, Codable, ExpressibleByStringLiteral {
162+
public enum Reason: Sendable, Codable, Equatable, ExpressibleByStringLiteral {
163163

164164
/// Indicates the notification is about someone liking a post from the user account.
165165
case like

0 commit comments

Comments
 (0)