metatext-app-ios-iphone-ipad/Shared/Model/PushSubscription.swift

27 lines
585 B
Swift
Raw Normal View History

2020-08-12 09:24:39 +02:00
// Copyright © 2020 Metabolist. All rights reserved.
import Foundation
struct PushSubscription: Codable {
struct Alerts: Codable, Hashable {
2020-08-14 23:41:55 +02:00
var follow: Bool
var favourite: Bool
var reblog: Bool
var mention: Bool
2020-08-24 01:39:52 +02:00
@DecodableDefault.True var poll: Bool
2020-08-12 09:24:39 +02:00
}
let endpoint: URL
let alerts: Alerts
let serverKey: String
}
2020-08-14 03:24:53 +02:00
extension PushSubscription.Alerts {
2020-08-24 01:39:52 +02:00
static let initial: Self = Self(
follow: true,
favourite: true,
reblog: true,
mention: true,
poll: DecodableDefault.True())
2020-08-14 03:24:53 +02:00
}