mastodon/app/models
Eugen Rochko 4b94e9c65e
Improve payload format of Web Push API now that it's open (#7521)
> Good lord what is happening in there

Previously the contents of the Web Push API payloads closely resembled the structure of JavaScript's [Notification](https://developer.mozilla.org/en-US/docs/Web/API/Notification). But now that the API is open to non-browser apps, and given that there is no required coupling between contents of the payload and a Notification object, here is how I changed the payload:

```json
{ 
  "access_token": "...",
  "preferred_locale": "en",
  "notification_id": "12345",
  "notification_type": "follow",
  "title": "So and so followed you",
  "body": "This is my bio",
  "icon": "https://example.com/avatar.png"
}
```

The title, body and icon attributes are included as a fallback so you can construct a minimal notification if you cannot perform a network request to the API to get more data.
2018-05-19 14:46:47 +02:00
..
admin
concerns Fix nil error in StatusFilter (#7470) 2018-05-13 20:26:30 +02:00
form
web Improve payload format of Web Push API now that it's open (#7521) 2018-05-19 14:46:47 +02:00
account.rb Add preference to hide following/followers lists (#7532) 2018-05-18 02:26:51 +02:00
account_domain_block.rb
account_filter.rb
account_moderation_note.rb
admin.rb
application_record.rb
backup.rb
block.rb Store URIs of follows, follow requests and blocks for ActivityPub (#7160) 2018-05-04 21:14:34 +02:00
context.rb
conversation.rb
conversation_mute.rb
custom_emoji.rb
custom_emoji_filter.rb
domain_block.rb
email_domain_block.rb
export.rb
favourite.rb
feed.rb
follow.rb Store URIs of follows, follow requests and blocks for ActivityPub (#7160) 2018-05-04 21:14:34 +02:00
follow_request.rb Store URIs of follows, follow requests and blocks for ActivityPub (#7160) 2018-05-04 21:14:34 +02:00
home_feed.rb
identity.rb
import.rb
instance.rb
instance_filter.rb
invite.rb
invite_filter.rb
list.rb
list_account.rb
list_feed.rb
media_attachment.rb
mention.rb
mute.rb
notification.rb
preview_card.rb
remote_follow.rb
remote_profile.rb
report.rb
report_filter.rb
report_note.rb
search.rb
session_activation.rb
setting.rb
site_upload.rb
status.rb Fixes/do not override timestamps (#7336) 2018-05-03 23:02:46 +02:00
status_pin.rb
stream_entry.rb
subscription.rb
tag.rb
user.rb Add preference to hide following/followers lists (#7532) 2018-05-18 02:26:51 +02:00
web.rb