Commit graph libervia-backend/libervia/backend/core/xmpp.py
Author SHA1 Message Date
Goffi
96bf3af324 Global reformatting with black. 2025-09-13 10:46:10 +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
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
ceb2484a37 core (xmpp): add origin and origin_label to message data:
If a message comes from a gateway, its type is used as `origin` in `extra`, and it has a
name, it's used as `origin_label`.
`is-bot` is also set when the sending entity is advertised as a bot.

rel 459
2025-06-08 17:16:56 +02:00
Goffi
14f50afa64 tests (unit/sqla): Add test for keyword filtering:
rel 458
2025-06-06 10:45:54 +02:00
Goffi
57f879f2d3 core (xmpp): parse <thread> element:
<thread> were generated from message data, but not parsed for incoming messages.

rel 457
2025-05-06 00:18:30 +02:00
Goffi
58a0e168e2 core (xmpp): Add missing f-string prefix 2025-04-11 21:49:46 +02:00
Goffi
0d40feedc5 types: Add SatXMPPClient to core types, add roster and improve type hints. 2025-04-11 18:19:28 +02:00
Goffi
54654b65ed core (types): improve SatXMPPEntity core type and type hints. 2025-01-13 01:23:10 +01:00
Goffi
1f3c6f0329 core (main): Let plugins have several handlers + various improvements:
`get_handler` can now return several handlers, which is notably useful for component with
several included services.

Various improvements such move to `async` method, docstring/type hints update, and slight
improvment of SatXMPPComponent.

rel 453
2024-12-03 00:11:00 +01:00
Goffi
489eed2540 plugin XEP-0033: code modernisation, improve delivery, data validation:
- Code has been rewritten using Pydantic models and `async` coroutines for data validation
  and cleaner element parsing/generation.
- Delivery has been completely rewritten. It now works even if server doesn't support
  multicast, and send to local multicast service first. Delivering to local multicast
  service first is due to bad support of XEP-0033 in server (notably Prosody which has an
  incomplete implementation), and the current impossibility to detect if a sub-domain
  service handles fully multicast or only for local domains. This is a workaround to have
  a good balance between backward compatilibity and use of bandwith, and to make it work
  with the incoming email gateway implementation (the gateway will only deliver to
  entities of its own domain).
- disco feature checking now uses `async` corountines. `host` implementation still use
  Deferred return values for compatibility with legacy code.

rel 450
2024-09-26 16:12:01 +02:00
Goffi
5513da8792 core (xmpp): move is_local to SatXMPPEntity + type hints + some log level changes. 2024-09-06 17:42:07 +02:00
Goffi
53fdaa9d09 Reformatted code base using black. 2024-06-19 18:44:57 +02:00
Goffi
03a8fc983e core (xmpp): fix message workflow interruption from trigger. 2024-06-12 22:37:04 +02:00
Goffi
ca7c061986 core (xmpp): Add a timeout for messages processing to avoid blocking the queue. 2024-04-06 12:21:04 +02:00
Goffi
ba1475962e core (tools/trigger): new add_with_check method:
this method add a wrapper which will skip the trigger is the plugin is not available in
the session (e.g. a component which doesn't use the plugin).
2023-12-09 19:19:26 +01:00
Goffi
0979b3fee3 core (message): fix calling of post treatments during message workflow 2023-12-01 18:20:27 +01:00
Goffi
b8854ad46c core (xmpp): message reception workflow refactoring:
- Call methods from a root async one instead of using Deferred callbacks chain.
- Use a queue to be sure to process messages in order.
2023-11-22 14:50:35 +01:00
Goffi
b3659079f5 backend: rename SatRosterProtocol to LiberviaRosterProtocol 2023-06-30 15:11:05 +02:00
Goffi
d2685ba11b refactoring: renamed sat package to libervia.backend 2023-06-02 11:49:51 +02:00
Renamed from sat/core/xmpp.py (Browse further)