Commit graph

4,579 commits

Author SHA1 Message Date
Goffi
399802455f memory (sqla_mapping): Add index on PrivateInd* tables:
`PriaveInd*` may be queried without `key`, in which case an index was missing.
2026-05-02 15:55:18 +02:00
Goffi
b7b5797262 tools (utils): Add aio_func attribute to @aio decorated methods:
We sometimes to need to call another method in asyncio context when we already are in this
context. With the `@aio` decorator which makes the method return a `Deferred`, it was
necessary to use a ping pong between `Deferred` and `Future`.
This patch adds a `aio_func` attribute which directly returns the wrapped asyncio method,
so it can now be awaited directly.
2026-05-02 15:55:18 +02:00
Goffi
610eac0718 Formatting + type hints 2026-05-02 15:55:18 +02:00
Goffi
1782fc69d1 memory (disco): fix return value for disco_infos bridge method:
empty `language` (`None`) was not converted to empty string, resulting in bridge error.
2026-05-02 15:55:18 +02:00
Goffi
8d42a09208 core (disco), plugins identidy, XEP-0115:
- Fix data types, and use quotes data type to avoid immediate evaluation on Python < 3.14
- Better error catching folling change in `get_infos` in `memory.disco`.
- Some code modernisation (async coroutine).
2026-05-02 15:55:18 +02:00
Goffi
7c8fae5703 dependencies: update Tx-XMPP to v0.14:
This version fixes upstream the empty subject bug, and handle nickname changes.
2026-04-24 17:48:00 +02:00
Goffi
9ffb729b8c cli (blog/preview): Fix preview:
- configuration handling was not updated
- there was a typo in `open_cb`
2026-04-24 17:39:01 +02:00
Goffi
c37694c014 cli: Python 3.14 compatibility fix 2026-04-24 17:38:57 +02:00
Goffi
80e5a9e6ac memory (disco): Fix error handling for find_service_entity/find_service_entities:
- Error raised by `disco_info` where not properly handler, resulting in an exception
  instead of appropriate logging and return value.
- `async` coroutines, type hints
2026-04-24 17:38:54 +02:00
Goffi
992d14cb86 core (xmpp): Message processing queue improvements:
Messages are now queued per conversation (i.e. one-to-one chats, or MUCs). This allows
messages to be treated in parallel instead of waiting sequentially for each one to be
processed.
2026-04-21 12:52:16 +02:00
Goffi
e41d2cf26f core (xmpp): Remove host from SatMessageProtocol:
It is not needed anymore to pass `host` to most classes, as it is now available as a
global variable with `G`.
2026-04-21 12:52:16 +02:00
Goffi
fd58b78762 core, dependencies: update Tx-XMPP to v0.13.0:
`DiscoFeature.identities` format has evolved so `(category, map)` can be checked directly
again. The code using identities has been updated.
2026-04-21 12:49:30 +02:00
Goffi
dd79a42931 plugin XEP-0115: refactoring and complete implementation:
- the XEP-0115 implementation has been completed with validation, caps node handling in
  disco requests, hash generation fixes, and real support for xml:lang.
- the `generate_hash` method has been moved from disco where it's not used anymore to
  XEP-0115.
- Disco doesn't hash systematically, it nos use a per-jid cache for non XEP-0115
  supporting client.
- code modernisation, with use of `get_plugin_data` for Client data in XEP-0115, type
  hints, etc.
- More comments have been added to link algorithms steps to the relevant part in
  specification.
2026-04-18 01:08:01 +02:00
Goffi
f6db575ee4 core, dependencies: Update Tx-XMPP to 0.12:
Tx-XMPP 0.12 has beaking change in `discoFeature.identities` because it now supports
`xml:lang` attribute, so this update implies updating the code everywhere were this is
used.
2026-04-17 17:26:54 +02:00
Goffi
1548276702 test: Python 3.14 compatibility update 2026-04-17 15:27:59 +02:00
Goffi
ec2cf0a522 core, dependencies: make Libervia compatible with Python 3.14:
- work around a deprecated behaviour in `asyncio.get_event_loop` until the fix is
  integrated in a released Twisted.
- update dependencies to have versions compatible with Python 3.14
- disable `term-image` which is bounded to incompatible Pillow version. It is unmaintained
  for 1 year, and will probably be removed soon in favor of `textual-image`.
2026-04-16 21:47:36 +02:00
Goffi
da1a5b691a plugin XEP-0473: Fix early exit when checking items:
The secrets were loaded for all items in `_items_trigger` instead of exiting early when
there is nothing to decrypt, this was inefficient, and showing annoying warnings.
2026-04-16 12:19:35 +02:00
Goffi
ae841fee0e tests (unit): Rename tests for consistency 2026-04-15 23:17:53 +02:00
Goffi
f03939e2af doc (components/pubsub): Pubsub component documentation:
fix 476
2026-04-15 22:15:46 +02:00
Goffi
e7c508b11c doc (components): Update Tigase doc URL (former was a dead link) 2026-04-15 22:15:18 +02:00
Goffi
42c2f88b30 component pubsub: PEP presence access model and auto-subscription
- Implement `presence` access model for PEP nodes.
- Add PEP auto-subscription (`+notify` handling)
- New `get_pep_last_items` storage method to retrieve in a single query items to send to
  auto-subscribers.
- Online resource tracking.

This completes the PEP support.

rel 476
2026-04-15 20:51:51 +02:00
Goffi
81bd3dcf01 component pubsub: PEP implementation:
New implementations of XEP-0355 and XEP-0356 are integrated to handle PEP. The
implementation is not complete yet, as auto-subscribe and presence permissions are not
implemented yet.

rel 476
2026-04-14 23:16:18 +02:00
Goffi
3aa58e73dc memory (sqla): new pep column in PubsubNode:
This column can be used for quick filtering on PEP nodes.

rel 476
2026-04-14 23:10:19 +02:00
Goffi
6605e523d0 plugin XEP-0356: Privileged Entity implementation:
This is the second XEP needed to implement PEP in Pubsub Component. This implementation
should be more or less complete.

rel 476
2026-04-14 23:08:21 +02:00
Goffi
ba9a2fc6d5 tests (unit/XEP-0338): Fix async call to xep_0338._jingle_handler_trigger 2026-04-14 23:06:12 +02:00
Goffi
f5e0152b32 plugin XEP-0355: Namespace Delegation implementation:
The admin mode is implemented. It is needed to handle PEP with Pubsub Component.

rel 476
2026-04-14 23:04:04 +02:00
Goffi
da2c2c49ea component pubsub: Implement "max_items":
A new `max_items` field has been added to `PubsubNode`. `0` means `max`. If any >0 value
is used, items will be automatically deleted by `cache_pubsub_items`. Items are currently
discarded (i.e. no notification is sent), this is the same behaviour as in legacy Libervia
Pubsub (formerly "SàT Pubsub").

rel 476
2026-04-11 12:47:40 +02:00
Goffi
c10c34304a tests (unit/email gateway): Fix tests 2026-04-11 12:46:47 +02:00
Goffi
c89b91c2e9 component pubsub: Integrate XEP-0499 extended discovery:
- Added `on_extended_disco()` handler.
- Added `with_parent=True` to all `get_pubsub_node()` calls to prevent lazy load errors in
  access checks.

rel 476

Registered XEP-0499 handler in `profile_connecting()` and added it to
plugin dependencies.
2026-04-11 12:46:47 +02:00
Goffi
f1ceb7db8e memory (sqla): Add with_parent and with_link to get_pubsub_nodes():
Added `with_parent` and `with_link` parameters for eager loading of parent and linked_node
relationships.

Fixed CTE to include all children (not just base nodes) and use `selectinload` for parent
to avoid cartesian products.

rel 476
2026-04-11 02:08:15 +02:00
Goffi
20bf3dffa1 plugin XEP-0499: metadata + filtering:
- Added `full_metadata` handling to return only relationship fields when requested.
- Implemented `filter_node_hierarchy_by_access` for access control filtering

rel 476
2026-04-11 02:03:22 +02:00
Goffi
31b55fbbe7 tests (unit/component pubsub): Fix tests
rel 476
2026-04-11 01:55:15 +02:00
Goffi
3492baaa65 component pubsub: integrate pubsub relationships:
Pubsub relationships from XEP-0496 are now handled. They can be set in config as explained
in the specification, and access are checked with parents when they are set.

Deletion cascade as specified in the XEP.

rel 476
2026-04-11 01:55:15 +02:00
Goffi
0c6921aad0 plugin XEP-0496: Pubsub Relationships implementation:
Add methods to handles the relationships which were already present in storage.
This plugins add methods to handle validation and rules from the specs.

`get_pubsub_node_children` helper method has been added to storage.
2026-04-11 01:55:15 +02:00
Goffi
4b91ea873e memory (sqla): New node_id, with_parent and with_link argument for get_pubsub_node:
- A node can now be retrieve directly by its ID.
- `with_parent` and `with_link` let load `parent_node` and `linked_node`.

rel 476
2026-04-10 22:02:53 +02:00
Goffi
2c3d11e7ff tests (unit): Pubsub component tests:
rel 476
2026-04-09 21:47:53 +02:00
Goffi
09bef94ffe plugin XEP-0373, tests (unit/XEP-0373): Make rpad size >= 50:
XEP-0420 bounds starts at 0 but 0-length rpad defeats its purpose (the XEP actually says
"TODO: sane boundaries?"). Furthermore, some tests where failing randomly due to 0-lenght
rpad sometimes happening. This patch makes rpad minimum size at 50.
2026-04-09 21:47:53 +02:00
Goffi
73b410aa97 tests (unit/cli/calls): Skip tests in case of missing media or webrtc:
Test were raising exceptions when optional modules were missing (GStreamer related modules
for `webrtc`). Those are now catched so the tests are simply skipped in this case.

`MissingModule` is now inheriting from `ImportError`, as it's a natural subclass, and it
makes import error catching easier.
2026-04-09 21:47:46 +02:00
Goffi
72d7868eb5 tests (unit/conftests): Add a reset_storage autouse fixture:
Storage can be modified by tests, and it is kept for the whole session, this may have side
effect resulting in other tests failing. This fixture avoid this problem by reseting
`storage` between each test.
2026-04-09 21:47:43 +02:00
Goffi
0cfeea8203 tests (unit/conftest): bridge is now a read-only property, update _bridge instead. 2026-04-09 21:47:07 +02:00
Goffi
378c6e3fef memory (sqla): docstrings/type hints improvements 2026-04-09 21:47:06 +02:00
Goffi
1013266cc5 component pubsub: remove node creation restriction to local user only:
External users should be able to create nodes, it is necessary for many feature such as
blog comments.

rel 476
2026-04-09 21:47:06 +02:00
Goffi
e7917b1b63 component pubsub: Implement remaining methods:
- `retract`, `purge` and `delete` are now implemented
- `features` list has been added
- `publish` now returns the Item ID when it is generated
- `subscribers` publish model is handled.

rel 476
2026-04-09 21:46:31 +02:00
Goffi
572662653f component pubsub: implement default configuration:
rel 476
2026-04-09 10:26:08 +02:00
Goffi
6b2c34190e component pubsub: implement notifications
rel 476
2026-04-09 10:11:29 +02:00
Goffi
5038fdb8f0 component pubsub: Implement subscription handling methods:
rel 476
2026-04-09 10:11:29 +02:00
Goffi
0a0735ec4c memory (sqla): Add methods to handle pubsub node subscriptions:
Add `get_pubsub_subscriptions` and `set_pubsub_subscriptions`.

rel 476
2026-04-09 10:11:29 +02:00
Goffi
753623e934 cli (pubsub/node/subscription/set): Fix bridge call 2026-04-08 16:16:20 +02:00
Goffi
34d6032cf5 component pubsub: Handle affiliations setting/retrieval:
Let retrieve affiliations for the whole service or a specific node, and set affiliations
for a node.

rel 476
2026-04-08 16:16:20 +02:00
Goffi
8ebf5360a2 component pubsub: publish and items retrieval implementation:
rel 476
2026-04-07 15:00:37 +02:00