Commit graph

4,761 commits

Author SHA1 Message Date
Goffi
88ba99acd0 core (types): Fix type hint for mess_id2uid 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
7b2afd238b core (xmpp): make client.encryption a property to make pyright happy 2026-07-09 17:13:37 +02:00
Goffi
5e89f1661e memory (disco): handle remote-server-timeout in get_infos errback:
`remote-server-timeout` is treated like `remote-server-not-found`.
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
46e0e3b582 core (xmpp): make message_parse an async trigger point 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
ebe072dbd4 memory (disco): fix incorrect use of await 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
e241075a34 core: Unseen message counter:
This patches add handling for unseen messages counter, and last message received. The
counters are retrieved from DB on startup, they updated in-memory. Frontend are expected
to have their own in-memory counter too, the backend one is used for re-sync (e.g.; on page
reload).

Bridge methods are added to retrieve the state, and indicate which message has been seen
last by user. A signal is sent on counter reset to all frontends can synchronise.

This is currently local only, but it should be compatible with a future XEP-0490 (Message
Displayed Synchronization) implementation.
2026-06-20 15:11:06 +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
7107d64a5b sqla (mapping): fix missing PEP constraint:
A constraint name was missing on the `PubsubNode.pep` column, resulting in a crash when
trying to generate the initial database on launch with an empty `local_dir`.

Migration script introducing the column (f4cb5fc600c7_add_missing_pep_check_constraint.py)
has been updated too. Another migration script has been made to add the constraint to
existing DB (only if they are missing).
2026-06-20 10:27:51 +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
8bc3b4156a doc (component): the section use a . now 2026-06-19 12:14:54 +02:00
Goffi
cf225eee83 core (constants): fix XDG config path:
The config path was using `APP_NAME` instead of `APP_NAME_FILE`, resulting in `Libervia`
(with uppercase `L`) used instead of `libervia`.
2026-06-19 12:10:14 +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
7c3333c20d install: lock file update. 2026-06-08 10:44:53 +02:00
Goffi
8b095c1989 install: tx-xmpp dependency update:
New version of `tx-xmpp` will be needed to properly generate XEP-0115 hash.

rel 486
2026-06-08 10:44:53 +02:00
Goffi
7ecd4d8a87 install: Change urwid-satext source URL:
`uv` starts complaining about `tar.bz2` archive, so `tar.gz` is now used for
`urwid-satext`.
2026-06-08 10:44:32 +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
84e92f9a98 doc (cli): Document xid commands:
fix 477
2026-06-06 12:36:14 +02:00
Goffi
a8ba049d6a cli (xid): Set of commands to handle XMPP Decentralized ID (XID):
Implement commands to get, create, revoke, verify, import/export XID, and sign/verify a
file or inline data.

rel 477
2026-06-06 12:34:00 +02:00
Goffi
be203cc73a tests (unit): Plugin XID tests:
rel 477
2026-06-06 12:33:46 +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
836a9c962e tools (common/uri): Modernization + more flexible URIs:
- Remove Python < 3.9 workaround
- Type hints + docstring update
- Accept `kwargs` when `type_` is `None`.

rel 477
2026-06-06 12:23:06 +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
23cbd8ff9d memory (sqla), bridge: New history_last_messages_metadata_get method:
This method is used to retrieve last messages and their timestamps. It's useful on frontend
startup to display data on last discussions.
2026-05-25 17:52:26 +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
e257600ad5 core (launcher): Separate add_subparsers for exensibility:
`add_subparsers` is now in its own method to it can be extended by a subclass. Notably
needed by web frontend to add its `local` command.
2026-05-22 18:27:46 +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
a722464238 bridge (embedded): Update and fix:
Fix embedded bridge and adapt to changes in core code:

- Add `EmbeddedBridgeSettings` so it can be used in settings.
- Add `AIOBridge` and `TwistedBridge` wrappers.
- Fix callbacks, instead of logging them (and breaking the errback chain), they are now
  raised using `BridgeException` like in other bridges.
- Ensure that a singleton `Bridge` is used between backend and frontend.
- Init backend on first call to `bridge_connect`.
- Add Python 3.14 fix (as it is normally done in Launcher which is not run with with
`embedded`, we have to do it there).
- Track generated files.
2026-05-21 21:09:43 +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
45395c729a core (xmpp): Return as soon as possible once connection is establied:
To improve connection time and UX in frontends, the `start_connection` returns immediately
after the connection is established (authentication successful), and the rest of
initialisation is now done in background. The `profile_ready` and
`profile_connection_error` signals can be used to track the end of the full connection
process.
Roster retrieval is now also done in background for the same reason.
`LiberviaRosterProtocol.got_roster` Deferred can be used to track roster retrieval.
2026-05-14 11:49:02 +02:00
Goffi
8780d2133f bridge: Add profile_connection_error signal 2026-05-14 11:49:02 +02:00