From 27844b7da2567491661f9ddd2d4662f9f1b3ce40 Mon Sep 17 00:00:00 2001 From: Vyr Cossont Date: Mon, 3 Feb 2025 02:25:53 -0800 Subject: [feature] Implement Web Push notification policy (#3721) * Web Push: add policy column to subscriptions * Web Push: add policy to API * Web Push: test notification policy * go-fmt unrelated file (how did this get thru?) --- internal/typeutils/frontendtointernal.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'internal/typeutils/frontendtointernal.go') diff --git a/internal/typeutils/frontendtointernal.go b/internal/typeutils/frontendtointernal.go index 82957ee05..b341aa6ae 100644 --- a/internal/typeutils/frontendtointernal.go +++ b/internal/typeutils/frontendtointernal.go @@ -231,3 +231,17 @@ func APIInteractionPolicyToInteractionPolicy( }, }, nil } + +func APIWebPushNotificationPolicyToWebPushNotificationPolicy(policy apimodel.WebPushNotificationPolicy) gtsmodel.WebPushNotificationPolicy { + switch policy { + case apimodel.WebPushNotificationPolicyAll: + return gtsmodel.WebPushNotificationPolicyAll + case apimodel.WebPushNotificationPolicyFollowed: + return gtsmodel.WebPushNotificationPolicyFollowed + case apimodel.WebPushNotificationPolicyFollower: + return gtsmodel.WebPushNotificationPolicyFollower + case apimodel.WebPushNotificationPolicyNone: + return gtsmodel.WebPushNotificationPolicyNone + } + return 0 +} -- cgit v1.2.3