Commit graph libervia-backend/libervia/backend/plugins/plugin_xep_0050.py
Author SHA1 Message Date
Goffi
da20bba2ab plugin XEP-0050: fix handling of form submitted in the first request:
form submitted on first request (without retrieval first) was broken, this patch fixes it.
2026-10-26 18:36:41 +01:00
Goffi
68da01a043 Dates update. 2026-03-31 12:57:17 +02:00
Goffi
51776603e0 depdencies, core: update Tx-XMPP to be version >= 10.0:
This version changes the package name, so all `wokkel` imports habe been replaced by
`tx_xmpp`
2026-03-24 16:42:27 +01:00
Goffi
f3f40848b3 black reformatting 2025-11-20 14:50:03 +01:00
Goffi
9fd3e33425 core: fix wrong calls to addElement. 2025-10-29 12:12:25 +01:00
Goffi
1b3593d95b plugin XEP-0050: Some more refactoring:
- Arguments are now grouped in a new `PageData` NamedTuple, making it simpler to use, and
  easier to extend.
- Page index is automatically calculated, and can be checked in callback to know which
  page to show.
- Form send by calling entity is automatically parsed, using original form to instantiate
  the right field types.
- A new `DataForm.get_field` method use Generic type as second argument to retrieve the
  right field when getting a `submit` form.
- Updated all classes registering Ad-Hoc commands to use the new system and simplify the
  code.
2025-10-10 17:44:04 +02:00
Goffi
eaf6f1f00b plugin XEP-0050: Improve page data handling:
- Ad-Hoc callbacks now receive only a `client` and a `page_data`.
- `page_data` keep all important data useful to process current page in a namedtuple.
- Submitted form is automatically parsed, so callback just has to check the data from there.
- Page index is automatically handled, so the handling by callback is no longed needed.
- Session data is now splitted in 2 dict: private for `AdHocCommandHandler`, and public
  for the callback.
2025-10-10 17:44:04 +02:00
Goffi
b07179a871 plugin XEP-0050: refactor to use Pydantic models:
Pydantic models are now used for Ad-Hoc commands callback data. The `AdHocCommand` model
can (de)serialise the callback by using its import string.
This change has several benefits:
- better data validation.
- the serialisation mechanism will make communication with frontends easier.
- open the door for automatic documentation.

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
759ffc443b plugin XEP-0050: fix allowed_magics arg and calls to add_ad_hoc_command. 2025-01-13 01:23:22 +01:00
Goffi
f1cc34cc53 plugin XEP-0050: small code quality improvements + add C.ENTITY_ADMINS magic key to allow administrators profiles 2023-12-10 15:08:08 +01:00
Goffi
d2685ba11b refactoring: renamed sat package to libervia.backend 2023-06-02 11:49:51 +02:00
Renamed from sat/plugins/plugin_xep_0050.py (Browse further)