mirror of
https://github.com/mastodon/mastodon-ios.git
synced 2025-01-22 05:32:28 +01:00
Fix Account + Source API usage (IOS-168)
This commit is contained in:
parent
6701586287
commit
43227416b8
@ -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
|
||||
}
|
||||
|
@ -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"
|
||||
|
@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user