Follow request notification type

This commit is contained in:
Justin Mazzocchi 2021-01-28 19:15:06 -08:00
parent 4fbda99bb6
commit 741545fc1f
No known key found for this signature in database
GPG Key ID: E223E6937AAFB01C
4 changed files with 7 additions and 0 deletions

View File

@ -141,6 +141,7 @@
"preferences.notification-types" = "Notification Types";
"preferences.notification-types.follow" = "Follow";
"preferences.notification-types.favourite" = "Favorite";
"preferences.notification-types.follow-request" = "Follow Request";
"preferences.notification-types.reblog" = "Reblog";
"preferences.notification-types.mention" = "Mention";
"preferences.notification-types.poll" = "Poll";

View File

@ -8,6 +8,7 @@ public struct PushSubscription: Codable {
public var favourite: Bool
public var reblog: Bool
public var mention: Bool
@DecodableDefault.True public var followRequest: Bool
@DecodableDefault.True public var poll: Bool
@DecodableDefault.True public var status: Bool
}
@ -23,6 +24,7 @@ public extension PushSubscription.Alerts {
favourite: true,
reblog: true,
mention: true,
followRequest: DecodableDefault.True(),
poll: DecodableDefault.True(),
status: DecodableDefault.True())
}

View File

@ -47,6 +47,7 @@ extension PushSubscriptionEndpoint: Endpoint {
"favourite": alerts.favourite,
"reblog": alerts.reblog,
"mention": alerts.mention,
"follow_request": alerts.followRequest,
"poll": alerts.poll,
"status": alerts.status
]]]
@ -57,6 +58,7 @@ extension PushSubscriptionEndpoint: Endpoint {
"favourite": alerts.favourite,
"reblog": alerts.reblog,
"mention": alerts.mention,
"follow_request": alerts.followRequest,
"poll": alerts.poll,
"status": alerts.status]]]
default: return nil

View File

@ -16,6 +16,8 @@ struct NotificationTypesPreferencesView: View {
isOn: $viewModel.pushSubscriptionAlerts.reblog)
Toggle("preferences.notification-types.mention",
isOn: $viewModel.pushSubscriptionAlerts.mention)
Toggle("preferences.notification-types.follow-request",
isOn: $viewModel.pushSubscriptionAlerts.followRequest)
Toggle("preferences.notification-types.poll",
isOn: $viewModel.pushSubscriptionAlerts.poll)
Toggle("preferences.notification-types.status",