mirror of
https://github.com/superseriousbusiness/gotosocial
synced 2025-06-05 21:59:39 +02:00
[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?)
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user