Merge branch 'develop' into feature/user-status-subscriptions
authorSadposter <hannah+pleroma@coffee-and-dreams.uk>
Wed, 10 Apr 2019 09:44:54 +0000 (10:44 +0100)
committerSadposter <hannah+pleroma@coffee-and-dreams.uk>
Wed, 10 Apr 2019 09:44:54 +0000 (10:44 +0100)
12 files changed:
1  2 
docs/api/pleroma_api.md
lib/pleroma/notification.ex
lib/pleroma/user.ex
lib/pleroma/user/info.ex
lib/pleroma/web/common_api/utils.ex
lib/pleroma/web/mastodon_api/mastodon_api_controller.ex
lib/pleroma/web/mastodon_api/views/account_view.ex
lib/pleroma/web/router.ex
test/notification_test.exs
test/user_test.exs
test/web/mastodon_api/account_view_test.exs
test/web/mastodon_api/mastodon_api_controller_test.exs

index 75569e0924e1e24a35620d618b4c095ac4fce0d9,a1ea41fe39b5103bcbbfccc4d38b026c2334af3a..dbe2503006ee9a9a22281347b556560a3df9efa7
@@@ -114,53 -136,15 +136,64 @@@ See [Admin-API](Admin-API.md
  * Method `POST`
  * Authentication: required
  * Params:
 -    * `id`: notifications's id
 +    * `id`: notification's id
  * Response: JSON. Returns `{"status": "success"}` if the reading was successful, otherwise returns `{"error": "error_msg"}`
 +
 +## `/api/v1/pleroma/accounts/:id/subscribe`
 +### Subscribe to receive notifications for all statuses posted by a user
 +* Method `POST`
 +* Authentication: required
 +* Params:
 +    * `id`: account id to subscribe to
 +* Response: JSON, returns a mastodon relationship object on success, otherwise returns `{"error": "error_msg"}`
 +* Example response:
 +```json
 +{
 +  "id": "abcdefg",
 +  "following": true,
 +  "followed_by": false,
 +  "blocking": false,
 +  "muting": false,
 +  "muting_notifications": false,
 +  "subscribing": true,
 +  "requested": false,
 +  "domain_blocking": false,
 +  "showing_reblogs": true,
 +  "endorsed": false
 +}
 +```
 +
 +## `/api/v1/pleroma/accounts/:id/unsubscribe`
 +### Unsubscribe to stop receiving notifications from user statuses
 +* Method `POST`
 +* Authentication: required
 +* Params:
 +    * `id`: account id to unsubscribe from
 +* Response: JSON, returns a mastodon relationship object on success, otherwise returns `{"error": "error_msg"}`
 +* Example response:
 +```json
 +{
 +  "id": "abcdefg",
 +  "following": true,
 +  "followed_by": false,
 +  "blocking": false,
 +  "muting": false,
 +  "muting_notifications": false,
 +  "subscribing": false,
 +  "requested": false,
 +  "domain_blocking": false,
 +  "showing_reblogs": true,
 +  "endorsed": false
 +}
 +```
++
+ ## `/api/pleroma/notification_settings`
+ ### Updates user notification settings
+ * Method `PUT`
+ * Authentication: required
+ * Params:
+     * `followers`: BOOLEAN field, receives notifications from followers
+     * `follows`: BOOLEAN field, receives notifications from people the user follows
+     * `remote`: BOOLEAN field, receives notifications from people on remote instances
+     * `local`: BOOLEAN field, receives notifications from people on the local instance
+ * Response: JSON. Returns `{"status": "success"}` if the update was successful, otherwise returns `{"error": "error_msg"}`
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge