Commit graph libervia-backend/sat/plugins
Author SHA1 Message Date
Goffi
f6ccf044da plugin XEP-0084: "User Avatar" implementation:
rel 368
2022-06-29 11:59:07 +02:00
Goffi
610e457bec plugin XEP-0292: vCard4 Over XMPP implementation:
implementation of vCard4, the dedicated <IQ/> protocol is not implemented because it's
obsoleted (see comments).

Fow now, only `fn`, `nickname` and `note` are handled.

rel 368
2022-06-29 11:58:00 +02:00
Goffi
fe11bc9a2b plugin identity: make the plugin compatible with component + description:
the plugin can now be used with components.

the new `description` field is now available.

rel 368
2022-06-29 11:49:03 +02:00
Goffi
35be6b741f plugin identity, XEP-0054: move avatar resizing and caching method to identity plugin:
resizing and caching is now done in identity plugin, to prepare for the implementation of
other XEP to handle avatars.

rel 368
2022-06-29 11:47:48 +02:00
Goffi
11d003b8c1 plugin XEP-0060: type hints 2022-06-29 11:36:31 +02:00
Goffi
66dc184866 plugin XEP-0191: fix wrong name and description 2022-06-17 18:25:55 +02:00
Goffi
c02dcf3d94 component AP gateway typing + remove unused activity arg from newAPDeleteItem
rel 367
2022-06-17 15:50:34 +02:00
Goffi
bfd9168449 component AP gateway: AP delete activity => message retract:
handle retractation of messages. As it is not possible to know from the AP item alone if
we need to to a message retractation (XEP-0424) or a pubsub retractation (XEP-0060), we
now cache sent message, and decide which method to use according to how the item is cached
(i.e. in message history or in pubsub cache).

rel 367
2022-06-17 14:15:23 +02:00
Goffi
8869b1b05d component AP gateway: message retractation => AP deletion
Convert XEP-0424 message retractation request to suitable AP delete activity.

The message workflow and its triggers are now used instead of a direct observer, as it is
now possible to do so with component, and this let other plugin to parse and eventually
update metadata.

rel 367
2022-06-17 14:15:23 +02:00
Goffi
7d3e66dc28 component AP gateway: set POST default response code to 202 (accepted) 2022-06-17 14:15:23 +02:00
Goffi
bcdd1356bb plugin XEP-424: Message Retractation implementation:
rel 367
2022-06-17 14:15:23 +02:00
Goffi
46132a523e plugin XEP-0428: Fallback Indication implementation:
rel 367
2022-06-17 14:15:23 +02:00
Goffi
f21f5255b0 plugin XEP-0422: Message Fastening implementation:
rel 367
2022-06-17 14:15:23 +02:00
Goffi
bb3e7ffa9b core (memory/sqla), plugin XEP-0359: always add origin-id, and store:
`origin-id` is now always added to messages, and it is stored to database in the new
column instead of `extra` when present.
2022-06-17 14:15:23 +02:00
Goffi
3ccd4280ac core (xmpp): adapt message workflow to components:
message workflow were not used for components so far. This patch activate it, normalise
namespace to the client one to simplify parsing, and use SatXMPPComponent.sendHistory and
SatXMPPComponent.receiveHistory to indicate if a component should store sent and received
message in database (they both default to False).

OTR plugin is deactivated for components.

rel 367
2022-06-17 14:15:23 +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
83a6d475a9 plugin XEP-0060: do not raise an error when not subscribed on unsubscribe:
when an error is received on unsubscribe because user was not subscribed, a warning is
logged, but no exception is raised anymore, as the expected result is reached.
2022-06-17 14:15:23 +02:00
Goffi
5f64ea2bf3 plugin XEP-0191: Blocking Command implementation:
rel 367
2022-05-27 12:12:16 +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
85911b33d4 plugin invitation: use store hint to be sure that the invitation is archived 2022-05-16 14:20:01 +02:00
Goffi
f4fa679e9c comp file sharing: handle admins in quotas 2022-05-15 14:15:24 +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
436bb119e8 plugin XEP-0277: be sure to have service set in item2mbdata and node when provided
rel 365
2022-05-13 18:50:33 +02:00
Goffi
6a0ca28f45 plugin XEP-0277: bridge method mbIsCommentNode + methods renaming 2022-05-13 18:48:41 +02:00
Goffi
36eb09e53e plugin XEP-0277: fix await trigger incorrectly used on a sync trigger 2022-05-13 18:46:51 +02:00
Goffi
ab2f9661d1 plugin pubsub cache: new resync argument to force resynchronisation in synchronize 2022-05-13 18:44:54 +02:00
Goffi
4e441258b3 plugin pubsub cache: more resilient node caching:
- cache only latest 20 items when disco infos are hidden and thus we can't discover
  feature/RSM implementation
- better handling of args when calling `storage.getItems`

rel 365
2022-05-13 18:43:42 +02:00
Goffi
d20e609a5c plugins XEP-0060, XEP-0376, XEP-0465, CLI: PAM + PSS implementation:
- update psSubscriptionsGet to use serialised return value
- implement XEP-0376 Pubsub Account Management
- implement XEP-0465 Public Pubsub Subscriptions
- CLI `pubsub` commands updated accordingly, and added `--public` flags to `subscribe`,
  `Subscriptions` and `node Subscriptions get`

⚠ `XEP-0465` is speculative, the XEP has been accepted by council but not published yet.
As is should be the next one, and current latest one is `XEP-0464`, `XEP-0465` has been
anticipated.

rel 365
2022-05-13 18:38:05 +02:00
Goffi
feee36791b plugin XEP-0060: use serialised options in psSubscribe + triggers update 2022-05-13 18:29:42 +02:00
Goffi
24a1355686 plugin XEP-0060: better filtering when looking for default pubsub service 2022-05-13 18:22:06 +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
5ca925996d comp AP: helper methods to get AP objects:
rel 364
2022-03-22 17:00:42 +01:00
Goffi
16664ab939 comp AP gateway: regular expression to parse Signature header:
rel 364
2022-03-22 17:00:42 +01:00
Goffi
7588951bd9 plugin XEP-0277: methods to check is a node is a comments node and to get its parent
rel 364
2022-03-22 17:00:42 +01:00
Goffi
0112d503ff plugin XEP-0059, cache: allow those plugins to work in component mode
rel 364
2022-03-22 17:00:42 +01:00
Goffi
81513eb7d8 plugin XEP-0060: specify sender using client.jid in subscribe:
this is necessary to do a subscription with a component managing a virtual JID (i.e. not
the JID of the component itself, but the one linked to a account, see
`SatXMPPComponent.getVirtualClient`).

rel 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
Goffi
643d491e80 component AP gateway: JID/node ⟺ AP outbox conversion:
- convert a combination of JID and optional pubsub node to AP actor handle (see
  `getJIDAndNode` for details) and vice versa
- the gateway now provides a Pubsub service
- retrieve pubsub node and convert it to AP collection, AP pagination is converted to RSM
- do the opposite: convert AP collection to pubsub and handle RSM request. Due to
  ActivityStream collection pagination limitations, some RSM request produce inefficient
  requests, but caching should be used most of the time in the future and avoid the
  problem.
- set specific name to HTTP Server
- new `local_only` setting (`True` by default) to indicate if the gateway can request or
  not XMPP Pubsub nodes from other servers
- disco info now specifies important features such as Pubsub RSM, and nodes metadata

ticket 363
2022-01-25 17:54:06 +01:00
Goffi
01a1bf8691 plugin XEP-0060, XEP-0163, XEP-0277, text syntaxes: make those plugins usable with components 2022-01-25 17:26:05 +01:00
Goffi
ab4468a50a plugin XEP-0277: various fixes + async:
- `NS_ATOM` is now set at class level, so it can be accessed by other plugins
- set `author` to `None` when no `name` element is found
- make `data2entry` a corountine
- fix incorrect use of yield in `trigger.point`
2022-01-25 17:22:15 +01:00
Goffi
738ef6ccf4 plugin XEP-0060: None must not be used for getItems's node 2022-01-25 17:16:37 +01:00
Goffi
e94df887d4 component file sharing: set server name at render time 2022-01-25 17:15:00 +01:00
Goffi
0d214783a3 component file sharing: fix incorrect use of returnValue in items async method 2022-01-25 17:13:32 +01:00
Goffi
7216345e31 plugin XEP-0384: fix typo in attribute 2022-01-25 17:06:28 +01:00
Goffi
14d00a9dda merge bookmark @ 2021-11-12 17:21:24 +01:00
Goffi
0008d3478e plugin events: store interest_id in data:
ID of the item in list of interest is needed to correctly modify (and notably retract) an
event.
2021-11-12 17:18:23 +01:00
Goffi
38ec47a4da plugin comp file sharing: don't use Deferred in return value 2021-11-05 18:11:24 +01:00
Goffi
ecc6f96990 plugin email invitations: re-use existing invitation for a given email:
if an invitation is done on an email which has already received an invitation, it is
re-used and no new XMPP account or Libervia profile is created (the name is modified
though).

This is currently done in an inefficient way due to `LazyPersistentBinaryDict` limitations
(all invitations are loaded and checked to find the email). A more efficient check should
be easier to implement with storage changes in 0.9 .
2021-11-05 18:11:18 +01:00
Goffi
d39a80ee5f plugin XEP-0264: replace SIZE_FULL_SCREEN by SIZE_BIG:
`SIZE_FULL_SCREEN` may result in large files, and BoB is currently used to transfer them,
resulting in potentially large stanza. As a result, Libervia profile can be disconnected
from server if stanza max size is reached.

As a temporary workaround, `SIZE_BIG` is now the maximum size used. This should be fixed
in 0.9 with a proper way to transfer large thumbnails (i.e. not BoB).
2021-11-05 18:08:39 +01:00