logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma git clone https://hacktivis.me/git/pleroma.git

ap_extensions.md (2136B)


  1. # AP Extensions
  2. ## Actor endpoints
  3. The following endpoints are additionally present into our actors.
  4. - `oauthRegistrationEndpoint` (`http://litepub.social/ns#oauthRegistrationEndpoint`)
  5. - `uploadMedia` (`https://www.w3.org/ns/activitystreams#uploadMedia`)
  6. ### oauthRegistrationEndpoint
  7. Points to MastodonAPI `/api/v1/apps` for now.
  8. See <https://docs.joinmastodon.org/methods/apps/>
  9. ### uploadMedia
  10. Inspired by <https://www.w3.org/wiki/SocialCG/ActivityPub/MediaUpload>, it is part of the ActivityStreams namespace because it used to be part of the ActivityPub specification and got removed from it.
  11. Content-Type: multipart/form-data
  12. Parameters:
  13. - (required) `file`: The file being uploaded
  14. - (optionnal) `description`: A plain-text description of the media, for accessibility purposes.
  15. Response: HTTP 201 Created with the object into the body, no `Location` header provided as it doesn't have an `id`
  16. The object given in the reponse should then be inserted into an Object's `attachment` field.
  17. ## ChatMessages
  18. `ChatMessage`s are the messages sent in 1-on-1 chats. They are similar to
  19. `Note`s, but the addresing is done by having a single AP actor in the `to`
  20. field. Addressing multiple actors is not allowed. These messages are always
  21. private, there is no public version of them. They are created with a `Create`
  22. activity.
  23. They are part of the `litepub` namespace as `http://litepub.social/ns#ChatMessage`.
  24. Example:
  25. ```json
  26. {
  27. "actor": "http://2hu.gensokyo/users/raymoo",
  28. "id": "http://2hu.gensokyo/objects/1",
  29. "object": {
  30. "attributedTo": "http://2hu.gensokyo/users/raymoo",
  31. "content": "You expected a cute girl? Too bad.",
  32. "id": "http://2hu.gensokyo/objects/2",
  33. "published": "2020-02-12T14:08:20Z",
  34. "to": [
  35. "http://2hu.gensokyo/users/marisa"
  36. ],
  37. "type": "ChatMessage"
  38. },
  39. "published": "2018-02-12T14:08:20Z",
  40. "to": [
  41. "http://2hu.gensokyo/users/marisa"
  42. ],
  43. "type": "Create"
  44. }
  45. ```
  46. This setup does not prevent multi-user chats, but these will have to go through
  47. a `Group`, which will be the recipient of the messages and then `Announce` them
  48. to the users in the `Group`.