Use Pydantic models for data used with bridge.
Also update `backend.models.core.DiscoIdentity` to have `None` as possible and default
value for `name`.
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.
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.
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.
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).
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
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.
- 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
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.
- 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.
- 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
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.
- Async coroutines, type hints
- Use client plugin data instead of per-profile dict
- Detect chat state availability with disco queries
- Better spec compliance
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.
`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.
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
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
- 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
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`.
- 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.
`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).
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.