diff --git a/Mastodon/Scene/Settings/Privacy and Safety/PrivacySafetyViewModel.swift b/Mastodon/Scene/Settings/Privacy and Safety/PrivacySafetyViewModel.swift index de2cd8cd2..8fde3b23d 100644 --- a/Mastodon/Scene/Settings/Privacy and Safety/PrivacySafetyViewModel.swift +++ b/Mastodon/Scene/Settings/Privacy and Safety/PrivacySafetyViewModel.swift @@ -147,9 +147,9 @@ extension PrivacySafetyViewModel { } manuallyApproveFollowRequests = account.locked == true - showFollowersAndFollowing = account.hideCollections == false - suggestMyAccountToOthers = account.discoverable == true - appearInSearches = account.indexable == true + showFollowersAndFollowing = account.source?.hideCollections == false + suggestMyAccountToOthers = account.source?.discoverable == true + appearInSearches = account.source?.indexable == true isUserInteractionEnabled = true } diff --git a/MastodonSDK/Sources/MastodonSDK/Entity/Mastodon+Entity+Account.swift b/MastodonSDK/Sources/MastodonSDK/Entity/Mastodon+Entity+Account.swift index 0044dfe2c..c9bde6c19 100644 --- a/MastodonSDK/Sources/MastodonSDK/Entity/Mastodon+Entity+Account.swift +++ b/MastodonSDK/Sources/MastodonSDK/Entity/Mastodon+Entity+Account.swift @@ -37,8 +37,6 @@ extension Mastodon.Entity { public let locked: Bool public let emojis: [Emoji] public let discoverable: Bool? - public let hideCollections: Bool? - public let indexable: Bool? // Statistical public let createdAt: Date @@ -73,9 +71,7 @@ extension Mastodon.Entity.Account: Codable { case locked case emojis case discoverable - case hideCollections = "hide_collections" - case indexable - + case createdAt = "created_at" case lastStatusAt = "last_status_at" case statusesCount = "statuses_count" diff --git a/MastodonSDK/Sources/MastodonSDK/Entity/Mastodon+Entity+Source.swift b/MastodonSDK/Sources/MastodonSDK/Entity/Mastodon+Entity+Source.swift index 2a7952b0b..99080e71b 100644 --- a/MastodonSDK/Sources/MastodonSDK/Entity/Mastodon+Entity+Source.swift +++ b/MastodonSDK/Sources/MastodonSDK/Entity/Mastodon+Entity+Source.swift @@ -26,7 +26,10 @@ extension Mastodon.Entity { public let sensitive: Bool? public let language: String? // (ISO 639-1 language two-letter code) public let followRequestsCount: Int? - + public let hideCollections: Bool? + public let indexable: Bool? + public let discoverable: Bool? + enum CodingKeys: String, CodingKey { case note case fields @@ -35,10 +38,13 @@ extension Mastodon.Entity { case sensitive case language case followRequestsCount = "follow_requests_count" + case hideCollections = "hide_collections" + case indexable + case discoverable } public static func withPrivacy(_ privacy: Privacy) -> Self { - Source(note: "", fields: nil, privacy: privacy, sensitive: nil, language: nil, followRequestsCount: nil) + Source(note: "", fields: nil, privacy: privacy, sensitive: nil, language: nil, followRequestsCount: nil, hideCollections: nil, indexable: nil, discoverable: nil) } } }