IceCubesApp/Packages/Models/Sources/Models/ServerPreferences.swift
2023-01-09 19:47:54 +01:00

24 lines
725 B
Swift

import Foundation
public struct ServerPreferences: Decodable {
public let postVisibility: Visibility
public let postIsSensitive: Bool
public let postLanguage: String
public let autoExpandmedia: AutoExpandMedia
public let autoExpandSpoilers: Bool
public enum AutoExpandMedia: String, Decodable {
case showAll = "show_all"
case hideAll = "hide_all"
case hideSensitive = "default"
}
enum CodingKeys: String, CodingKey {
case postVisibility = "posting:default:visibility"
case postIsSensitive = "posting:default:sensitive"
case postLanguage = "posting:default:language"
case autoExpandmedia = "reading:expand:media"
case autoExpandSpoilers = "reading:expand:spoilers"
}
}