metatext-app-ios-iphone-ipad/Mastodon/Sources/Mastodon/Entities/PushSubscription.swift

27 lines
662 B
Swift
Raw Normal View History

2020-08-31 01:33:11 +02:00
// Copyright © 2020 Metabolist. All rights reserved.
import Foundation
public struct PushSubscription: Codable {
public struct Alerts: Codable, Hashable {
public var follow: Bool
public var favourite: Bool
public var reblog: Bool
public var mention: Bool
@DecodableDefault.True public var poll: Bool
}
public let endpoint: URL
public let alerts: Alerts
public let serverKey: String
}
public extension PushSubscription.Alerts {
static let initial: Self = Self(
follow: true,
favourite: true,
reblog: true,
mention: true,
poll: DecodableDefault.True())
}