- Configuration is now made with TOML, and the documentation was outdated. It has been
rewritten for TOML, and autodoc is used to show configuration options available in code
(and keep it up-to-date).
- New isolation mode is documentated.
- (core/constants): fix the `tmp` isolation mode to inherits the parent configuration like
`normal`.
- `is_local`: now use `server_jid`.
- `aio_func`: pass the missing `self` argument (`aio_fund` is unbound).
- Declare `pubsub_service` in `core_types.SatXMPPEntity`
- plugin XEP-0277: fix handling of `MbData.from_element` when node is not specified (so we
use default node).
- plugin XEP-0346: `IdentityData`: fix field access, following move to Pydantic model.
- use the proper `urn:xmpp:jingle:muji:0` namespace
- replace XEP-0249 invitations with XEP-0482
- the dedicated `META_TYPE_GROUP_CALL` subtype is now used for the confirm action (instead
of `META_TYPE_MUC_INVITATION`)
- handle MUJI invitation: on accept, join the room, start preparing and answer with the
connection method element
- add the `<muji>` element to outgoing Jingle IQs
- propagate the call type (audio/video) in the MUJI invites (the `type` attribute), so the
invited clients set up the proper local stream
- the joining participant initiates the sessions with the other participants, using their
real JIDs, extracted from the presence (the room is set non-anonymous for that)
- only trust the `<muji>` element of a `session-initiate` from a member of the room
- add a `call_group_end` bridge method to clean the MUJI session
- typo fix in `META_TYPE_MUC_INVIRATION` (`R` instead of `T`)
PID of commands run with `CommandProtocol` are now tracked in memory and stopped/killed on
exit. A `pid_file` argument can be use to track the file on disk, which is useful to
detect stalled processes after a crash/unclean ending of the backend.
Add helper methods to stop and kill those processes.
We now use `client.is_message_printable` to check if message is printable. If it's not, we
block storage in DB and sending to bridge. The previous code could let message pass if
metadata were stored in `extra`.
Cleaning methods per-profile (`profile_disconnected`) and per-plugin (`unload`) were not
called correctly. They are now called on shutdown with the `before/shutdown` Twisted
event.
With this event, it's still possible to call Deferred and do cleaning requiring async
calls.
rel 479
Normally the backend is made to have a singleton instance, and handle all profiles.
However, it may be useful to run instances independently (e.g., for development, to run
components in independent processes, for testing, etc).
This was previously possible by using a specific configuration files at backend's root.
This patch introduce a cleaner way by using an isolation mode.
Isolation mode is activated by settings the `LIBERVIA_ISOLATION` environment variable to
the name of the isolated instance. `LIBERVIA_ISOLATION_MODE` can be used to specify one of
the following mode:
- normal (default): config and shared files are in XDG in a `isolated/<name>` subdirectory
(usually `~/.local/share/libervia/isolated/<name>` and
`~/.config/libervia/isolated/<name>`). Runtime files and other instance specific data
(such as D-Bus name) are also isolated. Config uses cascade as usual.
- full: same as above, but config isn't cascading, it's using only its own isolated config
file.
- tmp: same as normal but the local directory is put in a temporary directory, and deleted
on backend startup. It stays on termination, so data can be checked if necessary (this mode is
usually used for development).
This feature will notably be useful to test severless mode on a single machine.
rel 479
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.
- 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
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.
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.
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.
"Origin" request are disco requests to know if a message sender is a bot or coming from a
gateway. It was sending request on every message, including pubsub/PEP events, resulting
in requests done to many entities, including ones not cacheables (bare entities or third
party servers, without caps mechanisms).
To avoid that, the requests is now done only for printable messages. To use
`client.is_message_printable` correctly, origin check has be moved to the end, after
`message_parse` trigger, so attachments are added to data.
In case of dead server/component with lot of contacts, we may receive a lot of
`<presence>` error with `remote-server-not-found` conditions. This patch use this to mark
the server as unreachable and avoid to do disco queries there.
- When we want to disco a bare JID, disco its server instead, to avoid many uncached
requests. In most case, the server disco is enough to discover JID origin.
- Avoid exception on `exceptions.ExternalRequestError`, print a warning instead.
- Join method is completely refactored so a room is now joined immediately, and MAM
synchronisation happens in background.
- Legacy history is not used anymore to simplify code.
- Global simplification of the plugin, not more complicated states handling or message
caching.
A `profile_ready` signal is now sent, so all frontends can know when a profile is
connected, and we don't have to wait for `connect` bridge method and risk a timeout.
- Add `wal_checkpoint()` method to manually checkpoint Write-Ahead logs.
- Do the checkpoint on startup to start clean and avoid delay on first login.
- Add an `unload` method to clean DB on exit, and do a checkpoint there.
- Error raised by `disco_info` where not properly handler, resulting in an exception
instead of appropriate logging and return value.
- `async` coroutines, type hints
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.
- 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.
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.
- 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`.
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.
- update queries to handle correctly the `before=""` case and RSM order (older to newer)
while having correct order when `max_items` without RSM is used (then order it newer to
older).
- put RSM code path in a separated method for better readability.
- check values of `max_items` and `from_index` and raise exception is they are not
positive
- when using `before` or `after`, check that the item ID used as reference exists, and
raise an exception otherwise.
- updated docstring to reflect the new behaviour.
- update pubsub cache use of `get_items` with RSM, to adapt to new behaviour.
rel 476