Commit graph libervia-backend/libervia/backend/plugins
Author SHA1 Message Date
Goffi
dc9e3e98d5 plugin XEP-0045: Use disco as fallback for is_room:
If a room was not joined (e.g., due to failure), `is_room` was wrongly returning `False`.
Disco identity is now used as fallback to detect correctly is an entity is a room or not.
This changes makes `is_room` async, and by extension `get_bare_or_full` too.
2026-08-12 18:10:51 +02:00
Goffi
e5781641f3 plugin XEP-0045: Fix use of empty string for nicks:
If empty string is used for nick in `join` (e.g., due to a bridge call), take use part of
the JID. This fix the use of empty resource, which was resulting in rejection by the
server.
2026-08-12 18:02:14 +02:00
Goffi
25a491d7f0 plugin identity: Raise timeout:
5s timeout is too short, if the server is overloaded or connection is slow, it makes the
identity retrieval fail. 15s is more reasonable and matches timeout used for disco.
2026-08-12 17:57:13 +02:00
Goffi
1bfc7bd10b plugin XEP-0313: fallback to last N items in case of missing item:
If a reference item is missing (e.g., after server purge) we now fallback to last N items
(50 for now), instead of giving up.
2026-08-10 12:02:47 +02:00
Goffi
ad397e9705 plugin XEP-0199: fix typo 2026-07-22 02:27:10 +02:00
Goffi
b384c6bb8f app manager (weblate): Update images:
Update image to run on latest version, pin PostgreSQL to v18, and remove the now
deprecated `version` field.
2026-07-21 11:52:22 +02:00
Goffi
6b4f7252e3 plugin app manager, app manager docker: update implementation:
A new `application_update` bridge method is added to easily update images. Running
container are automatically updated if necessary.
2026-07-21 11:50:20 +02:00
Goffi
6119c37c0f plugin app manager docker: add support for Podman:
Podman can be used as a drop-in replacement for Docker, and it doesn't need root
permissions. The plugin now has a settings to use Podman, and use `auto` by default which
will choose the first found on the device (Podman is tested first).
2026-07-21 11:50:20 +02:00
Goffi
feae9ff38d plugin app manager docker (peertube): update image:
`chocobozzz/peertube:production-bookworm` is outdated, moving to
`chocobozzz/peertube:production` to avoid up-to-date versions.
2026-07-19 14:51:09 +02:00
Goffi
2ae02c8e4a plugin serverless: first draft, peer discovery on LAN:
Implement peer discovery on LAN using mDNS (via `zeroconf`).
A Peer ID is generated (via `libP2P`) per instance, and announced on backend startup.
Meanwhile, other peers are discovered on LAN. A signal is send on peer found and another
on peer lost.

There a bridge methods to find already discovered peers, and to get infos on serverless
(our own ID, adverised service name, and number of peers found).

`Zeroconf` runs in background in its own thread.

rel 479
2026-07-17 23:27:47 +02:00
Goffi
a539c21f9d plugin XEP-0060: fix exception on _node_cb modification:
Due to the yielding, `_node_cb` could be modified during node event management, resulting
in an exception. The items are now shallow copied to avoid issue.
2026-07-17 23:27:47 +02:00
Goffi
92cb52dd04 plugin XEP-0363, upload: compute hash on file upload:
- Hash (SHA-256) is now automacally computed when a file is uploaded via XEP-0363, and
  used if no hash has been specified by frontend already.
- Use named tuples (`UploadTracking` and `UploadResult`) to handle callback values.
- upload: fix a bug (missing variable) in `unregister` (which is not used yet anyway).
- usual docstring/type hints improvements
2026-07-09 17:13:37 +02:00
Goffi
dbc3973642 plugin XEP-0447: handle deferred sources:
XEP-0447 allow to send sources after the original message. Dino is doing that, and thus we
can't display attachment immediately with only the original message.

This patch handle that by updating the original message once the sources are received, and
emitting a `message_update` signal to notify frontends.
2026-07-09 17:13:37 +02:00
Goffi
14a50673a1 plugin XEP-0300: Fix hash encoding and use StrEnum for hashes:
- Fix the wrong encoding of the hash hex string value instead of the binary value.
- Use a `StrEnum` for model, use models specified in XEP-0414.
- Minor typing hint/docstring improvments.
2026-07-09 17:13:37 +02:00
Goffi
31296c6108 plugin XEP-0447: Mutiple-files support:
- multiple-files support now that the XEP has them. The legacy message compatibility layer
  is implemented too, with the new `message_sent` trigger for 1:1, and with follow-up
  messages sent on message echo for MUC.
- usual modernisation (type hints, `get_plugin_data`)
- (core) new `message_sent` trigger point
2026-07-09 17:13:37 +02:00
Goffi
a214ba6fe3 plugin XEP-0367: "Message Attaching" implementation 2026-07-09 17:13:37 +02:00
Goffi
5e272710f3 plugin XEP-0066: "Out of Band Data" implementation 2026-07-09 17:13:37 +02:00
Goffi
1b747b6ee1 plugin XEP-0447: fix wrong element used during parsing 2026-07-09 17:13:37 +02:00
Goffi
33f9554b94 plugin XEP-0264: Convert image to RGB if there is transparency:
JPEG doesn't support transparency, which was resulting in exception if a preview of an
image with transparency was made. This is now checked, and the image is converted if
necessary.
2026-07-09 17:13:37 +02:00
Goffi
7696afb3d8 core: uid is now set in extra in client.sendMessage:
By setting `uid` in extra, it can now be specified by frontends.
2026-07-09 17:13:37 +02:00
Goffi
5ed83ae9e3 plugin XEP-0085: Modernisation:
- Async coroutines, type hints
- Use client plugin data instead of per-profile dict
- Detect chat state availability with disco queries
- Better spec compliance
2026-07-02 15:35:23 +02:00
Goffi
7d2d97fa75 plugin XEP-0045: Notification on mention:
If a mention is detected in a MUC (`groupchat`, not DM), a notification is sent.
2026-06-26 23:03:24 +02:00
Goffi
b65325c1d6 plugin XEP-0084: Support multiple images format:
XEP-0084 implementation was only supporting PNG, but some client (notably Conversations)
don't publish PNG, so we have to handle a few other formats.
2026-06-21 12:52:57 +02:00
Goffi
a909d99fa9 plugin XEP-0374, XEP-0384: use debug instead of warning logs:
Those cases are expected on semi-anonymous rooms, thus a warning is inappropriate.
2026-06-20 15:06:55 +02:00
Goffi
09848498cd plugin XEP-0373: Fix local exceptions shadowing core.exceptions 2026-06-20 10:48:16 +02:00
Goffi
de13f16791 plugin XEP-0045: fix early return in availableReceived blocking room join:
On room join, the room object is created before the server's self-presence arrives.
`_getRoomUser()` thus returns `user=None` for the initial presence, which led to
`super().availableReceived(presence)` not being called, resulting in wrong typing of the
room and the room not really being joined.
2026-06-19 14:12:42 +02:00
Goffi
34ecf8b22e plugin XEP-0084: refactor get_avatar:
`get_avatar()` was checking the cache directly, bypassing `plugin_misc_identity`'s
`use_cache` flag. As a result, cache disabling was ineffective. It now fetches from the
PEP node and doesn't handle the cache anymore.

`_parse_metadata_info()` has been added to factorize the metadata parsing.
2026-06-09 16:12:39 +02:00
Syndace
5d9f2d2da9 plugin XEP-0384: code cleanup and failure tracking 2026-06-08 14:26:15 +02:00
Goffi
0f9bfc38ac plugin XEP-0115: minor reformatting 2026-06-08 14:26:15 +02:00
Goffi
67eea35d4e plugin XEP-0115: use the new raw_values from Tx-XMPP:
Libervia calls Tx-XMPP `typeCheck` on disco info reception to check and normalize values.
In the case of XEP-0115 this cause trouve as the normalization is lossy, and change the
type of some fields (booleans, JIDs). The new `raw_values` property has been added in
Tx-XMPP v0.15 to retrieve original `str` value, so this now used to build the hash.

fix 486
2026-06-08 10:44:53 +02:00
Goffi
29a39b771b plugin XEP-0115: Fix race condition on disco creation:
This patch chains disco query to `conn_deferred` to be sure that `client.disco` is set.

fix #484
2026-06-07 21:20:05 +02:00
Goffi
9d4c2bace9 plugin misc XID: XMPP Decentralized ID implementation:
XMPP Decentralized ID (XID) implementation. All the spec but private key synchronisation
is implemented, and private key can be synchronised with import/export method which
through a URI usable with QR Code as explained in the spec.

rel 477
2026-06-06 12:23:39 +02:00
Goffi
6aba4c6686 plugin XEP-0045: Fix variable used in logs. 2026-06-06 12:23:06 +02:00
Goffi
ed462a661b core (memory): Modernize methods signature/docstrings of encrypt_value and decrypt_value:
- Use `client` instead of `profile`
- Add `decrypt_value_by_profile` which is notably useful on client startup, when the
  encrypted password needs to be retrieved, and the `SatXMPPEntity` instance is not yet
  created.
- Add type hints/update docstrings

rel 477
2026-06-06 12:23:06 +02:00
Goffi
e0064e0372 component pubsub: Set default access model for PEP to presence 2026-05-27 15:28:11 +02:00
Goffi
ac315a4300 plugin XEP-0402: log a warning instead of an exception on TimeoutError. 2026-05-25 17:41:53 +02:00
Goffi
00c7f1b1a3 plugin XEP-402: log a warning instead of an exception on NotFound error. 2026-05-21 21:10:30 +02:00
Goffi
f5e065b56a plugin XEP-0465: Remove duplicate ps_public_subscriptions_get bridge method. 2026-05-21 21:10:30 +02:00
Goffi
15ad700b22 plugin XEP-0402: Fetch bookmarks on startup and handle autojoin. 2026-05-14 11:49:02 +02:00
Goffi
dce577bf3a plugin XEP-0163: type hints 2026-05-14 11:49:02 +02:00
Goffi
502d9aad19 plugin XEP-0313: Fix elements dump in the warning:
The use of `pp_elt` was printing the element instead of showing them in the warning
message.
2026-05-14 11:49:02 +02:00
Goffi
d8b083cdb0 plugin XEP-0384: Regenerate key on corrupted data. 2026-05-14 11:49:02 +02:00
Goffi
2b0f4bd192 plugin XEP-0033: Fix validation error when only metadata address are used:
XEP-0033 may be used as a simple metadata marker when sending messages (e.g. to indicate a
`replyto`). The validation was failing on that due to missing `to`, `cc` and `bcc`.
2026-05-14 11:49:02 +02:00
Goffi
709366fe13 plugin XEP-0084: fix avatar retrieval and disabling:
- Avatar disabling was not correctly handled for all cases, this should now be fixed.
- Avatar retrieval is now down only on PEP events, no directly anymore. `get_avatar` only
  returns cached version.
2026-05-04 16:49:07 +02:00
Goffi
89c23c8a4c plugin XEP-0084: Fix double feature advertising:
`NS_AVATAR_METADATA` is already advertised by `add_pep_event`, adding it to `getDiscoInfo`
too was resulting in double advertising, making the disco infos invalid for caching
(resulting in other devices repeatedly requesting disco#info).
2026-05-04 16:47:42 +02:00
Goffi
1c6ca838b5 plugin XEP-0473: Don't try do load secrets if there is not encrypted elements:
The plugin was trying to decrypt all pubsub events, without checking if there is
"encrypted" element first, resulting in warning for all clear events.

This patch fixes it by detecting <encrypted> element and exiting early if none is found.
2026-05-04 16:44:39 +02:00
Goffi
351b7e2140 plugin XEP-0356: Fix incorrect _on_presence definition 2026-05-04 16:44:39 +02:00
Goffi
18d3f0167f plugin XEP-0115: Fix disco duplicate on caps node query + check own generation:
When caps node was requested, disco infos was returned from cache + infos from normal
disco gathering, resulting in doubled items and other entities rejecting the disco info.

This is fixed by subclassing the disco handler to add a trigger. This trigger is used by
XEP-0115 to short circuit the disco gathering and returned its cached data instead.

Our own hash is re-generated on each connection, and validated, so if there is a bug, this
helps see and catch it.
2026-05-04 16:44:39 +02:00
Goffi
d2fd11df13 plugin XEP-215: Use bare JID instead of raising an exception on full jid. 2026-05-04 15:04:04 +02:00
Goffi
4a66addc34 plugin XEP-0402: Use cast for correct type hints. 2026-05-04 15:04:04 +02:00