2016-10-02 10:08:37 +00:00
Protocols
=========
2020-12-21 20:06:00 +00:00
Currently three 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.
* Matrix support cannot be considered usable as of yet.
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.
2020-12-21 20:06:00 +00:00
.. _matrix:
Matrix
------
The aim of Matrix support in this library is not to provide instant messaging but to wrap
the parts of the Matrix protocol that specifically are especially useful for social media
applications. The current ongoing work on `Ceruelan <https://matrix.org/blog/2020/12/18/introducing-cerulean> `_
provides much of what will be implemented in this library.
This library doesn't aim to be a homeserver or provide any part of the server to server API.
The plan is to provide an appservice to hook onto a separate homeserver that deals with all
the complex protocol related details. This library will then aim to abstract much of what the
appservice gives or takes behind the same API as is provided for the other protocols.
Currently support is being added, please visit back in future versions.