2016-10-02 10:08:37 +00:00
Protocols
=========
2019-10-05 22:57:24 +00:00
Currently two protocols are being focused on. Diaspora is considered to be stable with most
of the protocol implemented. ActivityPub support should be considered as alpha - all the basic
things work but there are likely to be a lot of compatibility issues with other ActivityPub
implementations.
2018-09-30 17:47:52 +00:00
For example implementations in real life projects check :ref: `example-projects` .
2016-10-02 10:08:37 +00:00
.. _diaspora:
Diaspora
--------
2018-09-30 17:47:52 +00:00
This library only supports the `current renewed version <http://diaspora.github.io/diaspora_federation/> `_ of the protocol. Compatibility for the legacy version was dropped in version 0.18.0.
2016-10-02 10:08:37 +00:00
2018-09-30 17:47:52 +00:00
The feature set supported is the following:
2016-10-02 10:08:37 +00:00
2018-09-30 17:47:52 +00:00
* Webfinger, hCard and other discovery documents
2016-10-02 10:08:37 +00:00
* NodeInfo 1.0 documents
* Social-Relay documents
* Magic envelopes, signatures and other transport method related necessities
* Entities as follows:
2018-09-30 17:47:52 +00:00
2016-10-02 10:08:37 +00:00
* Comment
* Like
* Photo
* Profile
* Retraction
* StatusMessage
2017-07-21 21:02:33 +00:00
* Contact
2017-08-17 18:33:18 +00:00
* Reshare
2016-10-02 10:08:37 +00:00
2018-09-30 17:47:52 +00:00
.. _activitypub:
2016-10-02 10:08:37 +00:00
2018-09-30 17:47:52 +00:00
ActivityPub
-----------
Features currently supported:
* Webfinger
2019-08-17 15:25:38 +00:00
* Objects and activities as follows:
2019-10-05 22:57:24 +00:00
* Actor (Person outbound, Person, Organization, Service inbound)
2019-08-17 15:25:38 +00:00
* Note, Article and Page (Create, Delete, Update)
2019-08-18 16:56:08 +00:00
* These become a `` Post `` or `` Comment `` depending on `` inReplyTo `` .
2019-08-17 15:25:38 +00:00
* Attachment images from the above objects
* Follow, Accept Follow, Undo Follow
* Announce
2019-08-18 16:56:08 +00:00
Namespace
.........
All payloads over ActivityPub sent can be identified with by checking `` @context `` which will include the `` pyfed: https://docs.jasonrobinson.me/ns/python-federation `` namespace.
2019-08-18 18:43:27 +00:00
Content media type
..................
2019-08-26 19:24:09 +00:00
The following keys will be set on the entity based on the `` source `` property existing:
* if the object has an `` object.source `` property:
* `` _media_type `` will be the source media type
* `` _rendered_content `` will be the object `` content ``
* `` raw_content `` will be the source `` content ``
* if the object has no `` object.source `` property:
* `` _media_type `` will be `` text/html ``
* `` _rendered_content `` will be the object `` content ``
* `` raw_content `` will object `` content `` run through a HTML2Markdown renderer
2019-08-18 18:43:27 +00:00
2019-10-05 22:57:24 +00:00
For outbound entities, `` raw_content `` is expected to be in `` text/markdown `` ,
specifically CommonMark. When sending payloads, `` raw_content `` will be rendered via
the `` commonmark `` library into `` object.content `` . The original `` raw_content ``
will be added to the `` object.source `` property.
2019-08-18 18:43:27 +00:00
Images
......
2019-10-05 22:57:24 +00:00
Any images referenced in the `` raw_content `` of outbound entities will be extracted
into `` object.attachment `` objects, for receivers that don't support inline images.
These attachments will have a `` pyfed:inlineImage `` property set to `` true `` to
indicate the image has been extrated from the content. Receivers should ignore the
inline image attachments if they support showing `` <img> `` HTML tags or the markdown
content in `` object.source `` .
2019-08-18 18:43:27 +00:00
2019-10-05 22:57:24 +00:00
For inbound entities we do this automatically by not including received attachments in
the entity `` _children `` attribute.