2020-08-30 23:33:11 +00: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
|
2021-01-29 03:15:06 +00:00
|
|
|
@DecodableDefault.True public var followRequest: Bool
|
2020-08-30 23:33:11 +00:00
|
|
|
@DecodableDefault.True public var poll: Bool
|
2021-01-29 01:57:17 +00:00
|
|
|
@DecodableDefault.True public var status: Bool
|
2020-08-30 23:33:11 +00:00
|
|
|
}
|
|
|
|
|
2021-03-29 06:04:14 +00:00
|
|
|
public let endpoint: UnicodeURL
|
2020-08-30 23:33:11 +00:00
|
|
|
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,
|
2021-01-29 03:15:06 +00:00
|
|
|
followRequest: DecodableDefault.True(),
|
2021-01-29 01:57:17 +00:00
|
|
|
poll: DecodableDefault.True(),
|
|
|
|
status: DecodableDefault.True())
|
2020-08-30 23:33:11 +00:00
|
|
|
}
|