about summary refs log tree commit diff
path: root/app/serializers/web
AgeCommit message (Collapse)Author
2018-08-23Only display web push notifications after API call (fixes #7902) (#8396)ThibG
* Only display web push notifications after API call (fixes #7902) * Decode then truncate instead of truncating then decoding in webpush serializer
2018-05-22Do not encode HTML entities in initial Web Push payload body (#7592)Eugen Rochko
2018-05-19Improve payload format of Web Push API now that it's open (#7521)Eugen Rochko
> 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-11Add REST API for Web Push Notifications subscriptions (#7445)Eugen Rochko
- POST /api/v1/push/subscription - PUT /api/v1/push/subscription - DELETE /api/v1/push/subscription - New OAuth scope: "push" (required for the above methods)
2017-09-02Fix WebPush (regression from #4524) (#4778)unarist
* Fix NoMethodError in Web::PushSubscription ``` undefined method `site_contact_email' for #<Class:0x00005976d13c40> /usr/local/bundle/gems/activerecord-5.1.3/lib/active_record/dynamic_matchers.rb:22:in `method_missing' /usr/local/bundle/gems/attr_encrypted-3.0.3/lib/attr_encrypted.rb:295:in `method_missing' /usr/local/bundle/gems/attr_encrypted-3.0.3/lib/attr_encrypted/adapters/active_record.rb:129:in `method_missing_with_attr_encrypted' /mastodon/app/models/web/push_subscription.rb:53:in `push_payload' ``` * Specify serializer in Web::NotificationSerializer
2017-09-02Add RoutingHelper (#4769)Yamagishi Kazutoshi
2017-09-01Fix NoMethodError (#4762)Eugen Rochko
2017-09-01Refactor Web::PushSubscription, remove welcome message (#4524)Eugen Rochko
* Refactor Web::PushSubscription, remove welcome message * Add missing helper * Use locale of the receiver on push notifications (#4519) * Remove unused translations * Fix dir on notifications