Commit graph libervia-backend/libervia/backend/plugins
Author SHA1 Message Date
Goffi
b882fb53ea plugin XEP-0004: New data form implementation using Pydantic:
This new model is easier to manipulate and serialize, and use the benefits from Pydantic's
data validation mechanisms. It has method to easily convert to/from Wokkel data form or
to/from a domish.Element.

rel 465
2025-10-01 17:57:47 +02:00
Goffi
a32b8bf9e8 plugin XEP-0050: use Enums and add type hints:
- Replaces namedtuple with enums which are more appropriate here.
- Add docstrings and type hints to `AdHocCommand`

rel 465
2025-10-01 17:57:47 +02:00
Goffi
96bf3af324 Global reformatting with black. 2025-09-13 10:46:10 +02:00
Goffi
63edb309f8 component email message: Mailing list messages cleaning:
For mailing-list messages:
    - convert all text-only messages to XHTML for consistency.
    - detect and flag "noisy" content, i.e. content which are not useful and annoying in
      forum-like view (full-lenght quoted previous messages, mailing-list signature)

rel 464
2025-09-11 21:17:47 +02:00
Goffi
412db6a216 component email (imap): fetch all recent emails instead of only the last one. 2025-09-11 21:10:35 +02:00
Goffi
81f63ef93e plugin XEP-0277: add mentions to extra data:
rel 463
2025-09-06 16:31:24 +02:00
Goffi
5c9c57588c plugin XEP-0376: Fix type hint for node which is optional in subscriptions. 2025-09-05 19:32:47 +02:00
Goffi
0a42dd3da3 core (main): renamed hasFeature to has_feature to fix inconsistency. 2025-09-05 19:31:50 +02:00
Goffi
57e71c326d component email gateway: implement pubsub relationships and pubsub extended discovery:
- Pubsub relationships are used to set node hierarchy (comments nodes are set as children of
corresponding pubsub nodes).
- XEP-0499 Extended Pubsub Discovery is used to return hierarchy of pubsub nodes and
  items.

rel 463
2025-08-31 12:34:37 +02:00
Goffi
70e76dd190 plugin XEP-0499 Pubsub Extended Discovery implementation:
- Implement Pubsub Extended Discovery, and Pydantic models to handle the data easily.
- `client.discoHandler` initialisation has been moved in `core.xmpp` at an earlier stage
  of the workflow as it has to be initialised so XEP-0499 could remove the default disco
  handler to handle disco itself.
- Removed `Disco handled` trigger point as it was not used.

rel 463
2025-08-31 12:34:30 +02:00
Goffi
5b18ba7313 plugin XEP-0060: Add a model to handle node metadata:
rel 463
2025-08-29 18:53:03 +02:00
Goffi
e1828b3672 component Email gateway: Convert mailing list to pubsub nodes:
- `Credentials` is now a Pydantic based model.
- Mailing list related emails are now detected hand saved as pubsub items, using XEP-0277
  blog items, and creating suitable nodes. The ID of the mailing list is used for root
  node.
- Mailing list items are currently restricted to recipient associated JID.
- Words in square bracket in title `[Like][That]` are removed and converted to blog
  categories.
- Method to convert between MbData and email (in both directions) have been created.

rel 462
2025-08-03 23:45:48 +02:00
Goffi
3dbd990902 backend: various fixes, and type hints improvments. 2025-08-03 23:36:22 +02:00
Goffi
cab460152c plugin XEP-0277: Make MbData a Pydantic model:
- MbData is now a Pydantic based model.
- Bridge method has been updated to use `service` and `node` from MbData instead of using
  separate fields.
- Added `In-Reply-To` to MbData.
- Adapted code using XEP-0277 to work with the changes.

rel 462
2025-08-03 23:35:21 +02:00
Goffi
b1e0e336c2 plugin XEP-0297: Reworked forward method and add bridge method:
`Forward` method has been reworked and now includes a fallback. XEP-0297 ask to not use
fallback, but following a discussion on xsf@, we agreed that this is a legacy thing and a
fallback should nowadays be used, I'll propose a patch to the specification.

A `message_forward` has been added to bridge.

rel 461
2025-07-04 12:33:42 +02:00
Goffi
030be64c45 plugin XEP-0428: Add missing "for" attribute:
The "for" attribute was missing from <fallback> element.

rel 461
2025-07-04 12:30:20 +02:00
Goffi
16f9e07ce1 minor type update and unused import removal. 2025-07-04 12:28:40 +02:00
Goffi
0df0b0a5d0 core (types): Renamed libervia.backend.core.core_types.MessageData to MessageDataLegacy:
There are 2 concurrent models, this one is an historical legacy. The type to use the one
from `libervia.backend.models.core`, and it will progressively be used everywhere and
fully based on Pydantic.
2025-07-04 12:28:00 +02:00
Goffi
8302d09cf6 plugin data policy: Data Policy implementation:
This plugin implement data policy parsing and an algorithm to calculate a score based on
them.

rel 460
2025-06-26 17:02:33 +02:00
Goffi
6c95b3bec8 component email gateway: Add basic disco policy:
rel 460
2025-06-26 17:01:41 +02:00
Goffi
331e7dc5c4 plugin identity: add a timeout when getting identities. 2025-05-15 17:45:19 +02:00
Goffi
51c40dd5f0 plugin XEP-0461: Message Replies implementation:
Implement message replies. Thread ID are always added when a reply is initiated from
Libervia, so a thread can continue the reply.

rel 457
2025-05-06 00:34:01 +02:00
Goffi
cfc4041b1d plugin XEP-0045: Fix _message_parse_trigger which was incorrectly breaking the trigger workflow:
`None` was returned in some case instead of `True`, breaking the trigger workflow.
2025-05-06 00:34:01 +02:00
Goffi
931052f40c plugin XEP-0444, storage: move get_history_from_xmpp_id to storage as it is generally useful. 2025-05-06 00:33:57 +02:00
Goffi
618fbcd750 plugin XEP-0433: Extended Channel Search implementation:
Implements client part of XEP-0433, and add its results to plugin JID Search.
2025-04-11 18:19:28 +02:00
Goffi
65c6aefd68 plugin XEP-0045: add MUC search to plugin JID search results. 2025-04-11 18:19:28 +02:00
Goffi
7f6081b54f plugin JID Search: Use Pydantic models + better handling of partial search. 2025-04-11 18:19:28 +02:00
Goffi
b6928f9b96 various minor fixes. 2025-04-11 18:19:28 +02:00
Goffi
174bf8de1a plugin XEP-0059: Use Pydantic models for RSM. 2025-04-11 18:19:28 +02:00
Goffi
7eb5d8f371 plugin autocrypt: Autocrypt protocol implementation:
Implementation of autocrypt: `autocrypt` header is checked, and if present and no public
key is known for the peer, the key is imported.

`autocrypt` header is also added to outgoing message (only if an email gateway is
detected).

For the moment, the JID is use as identifier, but the real email used by gateway should be
used in the future.

rel 456
2025-02-28 09:23:35 +01:00
Goffi
2a0f4e28f8 component email gateway: convert autocrypt header:
Autocrypt header must be transmitted in both directions to allow opportunistic end-to-end
encryption with this protocol.

Moved email validation regex to `tools/common/regex.py`, as it can be used in other
locations.

rel 456
2025-02-28 09:23:35 +01:00
Goffi
5681435532 plugin XEP-0131: update triggers priority + add headers to MessageDataExtra:
- Lower priority is used for triggers so other plugins can add headers before the XML is
  generated.
- Added `headers` to `MessageDataExtra` type.

rel 456
2025-02-28 09:23:35 +01:00
Goffi
906ade1894 component email gateway: implement Gateway Relayed Encryption:
MIME and OpenPGP are used.

rel 455
2025-01-13 01:23:22 +01:00
Goffi
ea6ecb3c91 plugin gre encrypter: implement GRE Encrypter: OpenPGP:
rel 455
2025-01-13 01:23:22 +01:00
Goffi
a76a9d9e23 plugin GRE formatter MIME: implements GRE Formatter: MIME:
rel 455
2025-01-13 01:23:22 +01:00
Goffi
bbebdc6f94 plugin GRE: implements Gateway Relayed Encryption:
rel 455
2025-01-13 01:23:22 +01:00
Goffi
759ffc443b plugin XEP-0050: fix allowed_magics arg and calls to add_ad_hoc_command. 2025-01-13 01:23:22 +01:00
Povilas Kanapickas
4326d01956 remove uses of twisted.internet.defer.returnValue
This function has been deprecated in Twisted 24.7.0.
2024-12-11 01:17:09 +02:00
Goffi
b7f4202a78 tests (unit/email gateway): add tests for pubsub service:
rel 453
2024-12-03 00:52:06 +01:00
Goffi
edad2c1064 component email gateway: Add a pubsub service:
a pubsub service is implemented to retrieve and manage attachments using XEP-0498.

rel 453
2024-12-03 00:13:23 +01:00
Goffi
9d5de6b61b component email gateway: attachments handling:
attachments are now stored, and metadata are created in database.

rel 453
2024-12-03 00:13:23 +01:00
Goffi
ef49768c31 plugin XEP-0498: "Pubsub File Sharing" implementation:
Partial implementation of XEP-0498, necessary to implement the service part in email
gateway.

rel 453
2024-12-03 00:13:23 +01:00
Goffi
7509323137 plugin XEP-0358: "Publishing Available Jingle Sessions" implementation:
rel 453
2024-12-03 00:13:07 +01:00
Goffi
319c607f39 plugins XEP-0300, XEP-0446, XEP-0447, XEP0448 and others: Refactoring to use Pydantic:
Pydantic models are used more and more in Libervia, for the bridge API, and also to
convert `domish.Element` to internal representation.

Type hints have also been added in many places.

rel 453
2024-12-03 00:12:38 +01:00
Syndace
1ec2b29854 XEP-0373 (OX): Adjust to gpgme updates: generate with explicit algorithm and subkeys 2024-07-13 18:28:28 +02:00
Goffi
e161ff2d57 plugin URI finder: make the regex ignore case. 2024-11-20 15:29:47 +01:00
Goffi
254554de99 plugin blog import dotclear: repalce deprecated cgi by html 2024-11-20 14:35:09 +01:00
Goffi
06a1eef720 plugin XEP-0048, XEP-0402; CLI (bookmarks): implement XEP-0402 (PEP Native Bookmarks):
- Former bookmarks implementation is now labeled as "legacy".
- XEP-0402 is now used for bookmarks when relevant namespaces are found, and it fallbacks
  to legacy XEP-0048/XEP-0049 bookmarks otherwise.
- CLI legacy bookmark commands have been moved to `bookmarks legacy`
- CLI bookmarks commands now use the new XEP-0402 (with fallback to legacy one
  automatically used if necessary).
2024-11-20 11:43:27 +01:00
Goffi
8443ddac65 plugin text syntaxes: update exception message to be more explicit when lxml_html_clean is missing. 2024-11-20 11:30:43 +01:00
Goffi
b9088dff79 plugin XEP-0215, XEP-0376: fix bad calls to hasFeature:
`hasFeature` was called like blocking code, missing the `await`. This has been fixed, and
is now using the `memory.disco.has_feature` version.
2024-09-30 14:14:38 +02:00