summaryrefslogtreecommitdiff
path: root/internal/typeutils/frontendtointernal.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/typeutils/frontendtointernal.go')
-rw-r--r--internal/typeutils/frontendtointernal.go14
1 files changed, 14 insertions, 0 deletions
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
+}