mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-01-09 08:00:13 +00:00
Add notification type for update notifications
Not used yet
This commit is contained in:
parent
6ed26e0a93
commit
053bad3ca1
|
@ -56,7 +56,8 @@ type Notification struct {
|
||||||
NotificationPendingReply NotificationType = 10 // NotificationPendingReply -- Someone has replied to a status of yours, which requires approval by you.
|
NotificationPendingReply NotificationType = 10 // NotificationPendingReply -- Someone has replied to a status of yours, which requires approval by you.
|
||||||
NotificationPendingReblog NotificationType = 11 // NotificationPendingReblog -- Someone has boosted a status of yours, which requires approval by you.
|
NotificationPendingReblog NotificationType = 11 // NotificationPendingReblog -- Someone has boosted a status of yours, which requires approval by you.
|
||||||
NotificationAdminReport NotificationType = 12 // NotificationAdminReport -- someone has submitted a new report to the instance.
|
NotificationAdminReport NotificationType = 12 // NotificationAdminReport -- someone has submitted a new report to the instance.
|
||||||
NotificationTypeNumValues NotificationType = 13 // NotificationTypeNumValues -- 1 + number of max notification type
|
NotificationUpdate NotificationType = 13
|
||||||
|
NotificationTypeNumValues NotificationType = 14 // NotificationTypeNumValues -- 1 + number of max notification type
|
||||||
)
|
)
|
||||||
|
|
||||||
// String returns a stringified, frontend API compatible form of NotificationType.
|
// String returns a stringified, frontend API compatible form of NotificationType.
|
||||||
|
@ -86,6 +87,8 @@ func (t NotificationType) String() string {
|
||||||
return "pending.reblog"
|
return "pending.reblog"
|
||||||
case NotificationAdminReport:
|
case NotificationAdminReport:
|
||||||
return "admin.report"
|
return "admin.report"
|
||||||
|
case NotificationUpdate:
|
||||||
|
return "update"
|
||||||
default:
|
default:
|
||||||
panic("invalid notification type")
|
panic("invalid notification type")
|
||||||
}
|
}
|
||||||
|
@ -118,6 +121,8 @@ func ParseNotificationType(in string) NotificationType {
|
||||||
return NotificationPendingReblog
|
return NotificationPendingReblog
|
||||||
case "admin.report":
|
case "admin.report":
|
||||||
return NotificationAdminReport
|
return NotificationAdminReport
|
||||||
|
case "update":
|
||||||
|
return NotificationUpdate
|
||||||
default:
|
default:
|
||||||
return NotificationUnknown
|
return NotificationUnknown
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,8 +76,7 @@ func alertsToNotificationFlags(alerts *apimodel.WebPushSubscriptionAlerts) gtsmo
|
||||||
n.Set(gtsmodel.NotificationReblog, alerts.Reblog)
|
n.Set(gtsmodel.NotificationReblog, alerts.Reblog)
|
||||||
n.Set(gtsmodel.NotificationPoll, alerts.Poll)
|
n.Set(gtsmodel.NotificationPoll, alerts.Poll)
|
||||||
n.Set(gtsmodel.NotificationStatus, alerts.Status)
|
n.Set(gtsmodel.NotificationStatus, alerts.Status)
|
||||||
// TODO: (Vyr) handle NotificationUpdate when edit patch is merged
|
n.Set(gtsmodel.NotificationUpdate, alerts.Update)
|
||||||
//n.Set(gtsmodel.NotificationUpdate, alerts.Update)
|
|
||||||
n.Set(gtsmodel.NotificationAdminSignup, alerts.AdminSignup)
|
n.Set(gtsmodel.NotificationAdminSignup, alerts.AdminSignup)
|
||||||
n.Set(gtsmodel.NotificationAdminReport, alerts.AdminReport)
|
n.Set(gtsmodel.NotificationAdminReport, alerts.AdminReport)
|
||||||
n.Set(gtsmodel.NotificationPendingFave, alerts.PendingFavourite)
|
n.Set(gtsmodel.NotificationPendingFave, alerts.PendingFavourite)
|
||||||
|
|
|
@ -2964,7 +2964,7 @@ func (c *Converter) WebPushSubscriptionToAPIWebPushSubscription(
|
||||||
Reblog: subscription.NotificationFlags.Get(gtsmodel.NotificationReblog),
|
Reblog: subscription.NotificationFlags.Get(gtsmodel.NotificationReblog),
|
||||||
Poll: subscription.NotificationFlags.Get(gtsmodel.NotificationPoll),
|
Poll: subscription.NotificationFlags.Get(gtsmodel.NotificationPoll),
|
||||||
Status: subscription.NotificationFlags.Get(gtsmodel.NotificationStatus),
|
Status: subscription.NotificationFlags.Get(gtsmodel.NotificationStatus),
|
||||||
Update: false, // TODO: (Vyr) handle NotificationUpdate when edit patch is merged
|
Update: subscription.NotificationFlags.Get(gtsmodel.NotificationUpdate),
|
||||||
AdminSignup: subscription.NotificationFlags.Get(gtsmodel.NotificationAdminSignup),
|
AdminSignup: subscription.NotificationFlags.Get(gtsmodel.NotificationAdminSignup),
|
||||||
AdminReport: subscription.NotificationFlags.Get(gtsmodel.NotificationAdminReport),
|
AdminReport: subscription.NotificationFlags.Get(gtsmodel.NotificationAdminReport),
|
||||||
PendingFavourite: subscription.NotificationFlags.Get(gtsmodel.NotificationPendingFave),
|
PendingFavourite: subscription.NotificationFlags.Get(gtsmodel.NotificationPendingFave),
|
||||||
|
|
|
@ -3603,7 +3603,7 @@ func NewTestWebPushSubscriptions() map[string]*gtsmodel.WebPushSubscription {
|
||||||
gtsmodel.NotificationReblog,
|
gtsmodel.NotificationReblog,
|
||||||
gtsmodel.NotificationPoll,
|
gtsmodel.NotificationPoll,
|
||||||
gtsmodel.NotificationStatus,
|
gtsmodel.NotificationStatus,
|
||||||
// TODO: (Vyr) add NotificationUpdate when edit patch is merged
|
gtsmodel.NotificationUpdate,
|
||||||
gtsmodel.NotificationAdminSignup,
|
gtsmodel.NotificationAdminSignup,
|
||||||
gtsmodel.NotificationAdminReport,
|
gtsmodel.NotificationAdminReport,
|
||||||
gtsmodel.NotificationPendingFave,
|
gtsmodel.NotificationPendingFave,
|
||||||
|
|
Loading…
Reference in a new issue