metatext/Shared/Model/MastodonPreferences.swift

31 lines
919 B
Swift
Raw Normal View History

2020-08-07 01:41:59 +00:00
// Copyright © 2020 Metabolist. All rights reserved.
import Foundation
struct MastodonPreferences: Codable {
enum CodingKeys: String, CodingKey {
case postingDefaultVisibility = "posting:default:visibility"
case postingDefaultSensitive = "posting:default:sensitive"
case postingDefaultLanguage = "posting:default:language"
case readingExpandMedia = "reading:expand:media"
case readingExpandSpoilers = "reading:expand:spoilers"
}
let postingDefaultVisibility: Status.Visibility
let postingDefaultSensitive: Bool
let postingDefaultLanguage: String?
let readingExpandMedia: ExpandMedia
let readingExpandSpoilers: Bool
}
extension MastodonPreferences {
enum ExpandMedia: String, Codable, Unknowable {
case `default`
case showAll
case hideAll
case unknown
2020-08-07 03:57:52 +00:00
static var unknownCase: Self { .unknown }
2020-08-07 01:41:59 +00:00
}
}