Commit graph libervia-backend/sat/plugins/plugin_comp_ap_gateway/constants.py
Author SHA1 Message Date
Goffi
9e2f4571f6 component AP gateway: convert XMPP mentions to AP:
When a XEP-0372 mention is received, the linked pubsub item is looked after in cache, and
if found, it is send to mentioned entity with `mention` tag added.

However, this doesn't work in some cases (see incoming doc for details). To work around
that, `@user@server.tld` type mention are also scanned in body, and mentions are added
when found (this can be disabled with `auto_mentions` setting).

Mention are only scanned in "public" messages, i.e. for pubsub items, and not direct
messages.

rel 369
2022-07-10 16:15:06 +02:00
Goffi
2c654e017d component AP gateway: convert AP mention to XEP-0372 mentions:
when a mentions are found in AP items (either with people specified directly as target, of
with `mention` tags as in
https://www.w3.org/TR/activitystreams-vocabulary/#microsyntaxes), they are converted to
XEP-0372 `mention` references.

This is only done for Pubsub items (i.e. not for private messages).

rel 369
2022-07-10 15:16:15 +02:00
Goffi
68c627570d component AP: convert AP identity data to XMPP:
metadata are converted to vCard4 (XEP-0292).
Avatar is converted to User Avatar (XEP-0084), it is downloaded, resized, converted and
cached on first request.

If avatar is bigger than 5 Mio, it won't be used.

rel 368
2022-06-29 12:12:09 +02:00
Goffi
408dc04ee6 component AP gateway: convert Delete AP activities to corresponding Pubsub retract:
when a `Delete` actity is received, the item is removed from cache, and the corresponding
item `retract` is sent to local XMPP subscribers.

rel 367
2022-06-17 14:15:23 +02:00
Goffi
4e0c1fe7bf comp AP gateway: convert pubsub item retractation to AP Delete activity:
when an item `retract` is received from a node from which an AP actor is subscribed, a
corresponding `Delete` activity is created and sent to AP followers.

Trying to retract an item from a virtual node of the gateway pubsub service now return a
`forbidden` stanza error (those nodes are handled on AP side and thus are not owned by
XMPP entities).

rel 367
2022-06-17 14:15:23 +02:00
Goffi
fa81d96d79 comp AP gateway: message conversion:
Convert direct AP items to XMPP `<message>` stanzas, and vice versa.
Documentation will follow soon to explain the behaviour.

rel 366
2022-05-24 17:57:36 +02:00
Goffi
0114769fa4 comp AP gateway: publish, (un)subscribe/(un)follow, public subscription/following/followers:
this patch implements those major features:

- `publish` is implemented on virtual pubsub service, thus XMPP entities can now publish
  to AP using this service
- replies to XMPP items are managed
- `inReplyTo` is filled when converting XMPP items to AP objects
- `follow` and `unfollow` (actually an `undo` activity) are implemented and mapped to
  XMPP's (un)subscribe. On subscription, AP actor's `outbox` collection is converted to
  XMPP and put in cache. Subscriptions are always public.
- `following` and `followers` collections are mapped to XMPP's Public Pubsub Subscription
  (which should be XEP-0465, but the XEP is not yet published at the time of commit), in
  both directions.
- new helper methods to check if an URL is local and to get JID from actor ID

doc will follow to explain behaviour

rel 365
2022-05-13 19:12:33 +02:00
Goffi
8a2154ccca comp AP gateway: signature checking, caching and threads management:
- HTTP signature is checked for incoming messages
- AP actor can now be followed using pubsub subscription. When following is accepted, the
  node is cached
- replies to posts are put in cached pubsub comment nodes, with a `comments_max_depth`
  option to limit the number of comment nodes for a root message (documentation will come
  to explain this).

ticket 364
2022-03-22 17:00:42 +01:00
Goffi
3801db7835 component AP gateway: split plugin in several files:
constants, HTTP server and Pubsub service have been put in separated files.

rel: 363
2022-01-31 18:35:49 +01:00