Commit graph

2,520 commits

Author SHA1 Message Date
Link Mauve
58735d6a70 Bump all outdated dependencies
skip-changelog: This isn’t a user-facing change.
2026-05-21 13:26:08 +02:00
famfo
697d4d3bef
tokio-xmpp: update hickory-dns to 0.26 2026-05-21 13:21:46 +02:00
Paul Fariello
3d38a54389 Add XEP-0333 Displayed markers
Add XEP-0333 Displayed markers
2026-05-09 22:08:10 +02:00
Jonas Schäfer
e2dcd8ac66 Stop being pedantic by default
Up to now, the xmpp-rs projects have been very strict about incoming
data. This has served us, as developers of the libraries, well,
uncovering bugs in our and remote implementations which we could then
get fixed.

However, this behaviour is unexpected to users of the library. In the
XMPP world, unexpected child elements and attributes are generally
expected to be ignored. While this could be opted-into previously, the
feature flag for that sounded more dangerous than it was
("disable-validation"). In addition, the tribal knowledge needed to know
about that feature flag may not have reached some people who tried the
library and gave up because of that.

With this change, we make the non-pedantic behaviour the default. For
development and debugging purposes, users can always opt into the
pedantic behaviour as needed, using the newly-introduced `pedantic`
feature flags on all affected crates.
2026-03-27 12:51:51 +01:00
Jonas Schäfer
65c1f5ab10 parsers: fix tests with --features disable-validation and/or component
This disables a bunch of tests when the component feature is disabled,
because that feature changes the namespace of the <message/> element,
which causes the tests to fail.

Thanks to debacle for finding this.
2026-03-03 17:41:27 +01:00
Tobias Deiminger
109356f129 sasl: Support getrandom 0.3 and 0.4
getrandom 0.4.1 was released on 2026-02-03. sasl can use it without code
change.
2026-03-03 13:13:27 +01:00
Link Mauve
a5cb228ee8 jid: Bump to 0.12.2 2026-02-26 17:03:30 +01:00
Link Mauve
09cd01424a jid: Bump to edition 2024 2026-02-26 17:03:30 +01:00
Link Mauve
7f1dc96fac jid: Add support for XEP-0106: JID Escaping
This is used by Slidge, through slixmpp, and could be useful for any
other gateway based on this crate.
2026-02-22 08:38:30 +01:00
Link Mauve
bc88134c41 xmpp-parsers: Make DiscoInfoResult::features a BTreeSet
Features must never be duplicated, so we can use a BTreeSet instead of a
Vec to be nicer for users.

It makes the internal API for computing caps and ecaps2 a bit worse,
because it was expecting a slice directly, so for now let’s collect the
BTreeSet into a Vec when computing the thing.  A refactor to use
Iterator might make it better eventually, but I won’t work on that
before profiling it.
2026-02-21 20:58:33 +01:00
Link Mauve
946d96d7c8 xmpp-parsers: Remove Feature from disco#info
This was just a newtype for a String, but in general using it was harder
than without it.  This simplifies the public API.
2026-02-21 20:19:07 +01:00
Jonas Schäfer
d9f030c07e xso: add support for passing rxml::Options 2026-02-21 13:56:50 +01:00
Jonas Schäfer
bb02836097 Bump rxml to 0.14.0 2026-02-21 13:56:50 +01:00
Link Mauve
954efd2673 xmpp-parsers: Add XEP-0494 (Client Access Management) 2026-02-21 11:50:34 +01:00
Link Mauve
6d18641ace xmpp-parsers: Add support for <bandwidth/> in Jingle RTP Description
This was missing according to the specification, but I have never seen
it used in the wild.
2026-02-21 11:40:46 +01:00
Link Mauve
3107259337 xmpp-parsers: Use #[xml(extract)] for the two values
This simplifies the API, and avoids extra newtypes.
2026-02-21 11:38:01 +01:00
Link Mauve
dbe7925d83 xmpp-parsers: Use #[xml(flag)] for rtcp-mux
Also test that it gets deserialized correctly.
2026-02-21 11:36:35 +01:00
Link Mauve
4d6e1363db xmpp-parsers: Replace bind::Required with an #[xml(flag)]
This makes the code simpler to read.
2026-02-21 11:36:34 +01:00
Link Mauve
ca6e04f931 xmpp-parsers: Simplify StreamFeatures::sasl_mechanisms
This was already just a wrapper around a Vec<String>, but we can do away
with the wrapper thanks to #[xml(extract)].

I’ve also replaced Vec with BTreeSet, since that corresponds better to
how the mechanisms are.
2026-02-21 11:34:05 +01:00
Jonas Schäfer
0c6772aa7d parsers: derive Default for ibr::LegacyQuery
Very useful when composing a query.
2026-02-21 08:49:56 +00:00
Jonas Schäfer
6cc0df47d7 xso: fix build with minidom and without std 2026-02-21 09:36:57 +01:00
Link Mauve
cc3f22d418 xmpp-parsers: Import FromStr from core
This was needlessly imported from std.

skip-changelog: This is no public change whatsoever.
2026-02-18 19:48:49 +00:00
Link Mauve
67ef9654dc xmpp-parsers: Use Borrow and Cow from core and alloc
These were needlessly imported from std.

skip-changelog: This is no public change whatsoever.
2026-02-18 19:48:49 +00:00
Link Mauve
eda94997f0 minidom: Use Borrow and Hash from core
These were needlessly imported from std.

skip-changelog: This is no public change whatsoever.
2026-02-18 19:48:49 +00:00
Link Mauve
4f11d2fe5c xmpp-parsers: Implement XEP-0507: Jingle Content Category
This gives the semantic of each video contents in a Jingle session.
2026-02-18 18:00:20 +00:00
famfo
628c2113d0 tokio-xmpp: add option to disable xmpp_parsers validation 2026-02-18 16:53:38 +00:00
famfo
4316bb02a5 tokio-xmpp: implicitly add bound_jid on received IQs 2026-02-18 17:33:31 +01:00
Jonas Schäfer
a1ade974b0 stanzastream: actually count stanzas in stream management
Looks like a horrible oversight. And this will need tests, but I'm short
on time right now.

Fixes #170.
2026-02-11 10:10:46 +01:00
Jonas Schäfer
3bda04124e tokio-xmpp: publish auth method 2026-02-11 08:23:29 +01:00
pep
65c3e0dee7 xmpp: Remove noisy debug logs
skip-changelog

Signed-off-by: pep <pep@bouah.net>
2026-01-27 21:30:14 +00:00
famfo
f7931e95b6 tokio-xmpp: implicitly add bound_jid to IQs 2026-01-27 21:23:51 +00:00
pep
cff9195d6e
xmpp: Only send RoomSubject with empty body
Signed-off-by: pep <pep@bouah.net>
2026-01-27 22:04:33 +01:00
pep
d910cb9944
tokio-xmpp: Update Changelog for AsRawFd
Signed-off-by: pep <pep@bouah.net>
2026-01-25 16:41:57 +01:00
Alexander Brook Perry
b046d36424 tokio-xmpp: gate AsRawFd behind ktls feature
`AsRawFd` was breaking compilation on Windows.

skip-changelog: ktls support hasn't been released yet

Signed-off-by: pep <pep@bouah.net>
2026-01-25 08:21:39 +00:00
pep
22292c86cc
xmpp: Replace unimplemented! and panic! with info! calls
It's great for debugging for fast-paced implementations but the codebase
has been more or less the same for years now (in a state we don't
exactly like, but it is what it is) and this is hindering things more
than helping.

Keep it at the INFO level nonetheless to make it more or less obvious
these things are not implemented.

Signed-off-by: pep <pep@bouah.net>
2026-01-15 13:19:42 +01:00
Link Mauve
58ed1592f0 xmpp-parsers: Parse the ibr feature in StreamFeatures
This was surprisingly missing before.
2026-01-09 00:49:34 +01:00
Link Mauve
d0062d9931 xmpp-parsers: Split ibr::Query into multiple structs
This introduces FieldsQuery, RemoveQuery, LegacyQuery and FormsQuery,
making this module reflect more accurately how it gets used on XMPP.
2026-01-09 00:49:17 +01:00
pep
f6d4ab9e91 minidom: Bump rxml dep
This should have been done in 19865e5f probably, before the latest
release. This generally causes users of the library to cargo update
manually.

Signed-off-by: pep <pep@bouah.net>
2026-01-08 23:01:58 +00:00
pep
a2ed5026f0 xmpp: Allow resyncs in Agent::join_room
Signed-off-by: pep <pep@bouah.net>
2026-01-04 23:33:08 +01:00
pep
6624dffe25
jid: Allow for deserializers which cannot provide borrowed strings
skip-changelog: already in there.

Signed-off-by: pep <pep@bouah.net>
2026-01-03 21:28:49 +01:00
pep
89feaa0391
jid: Gate struct introduced in 60bf821c6 behind 'serde' feature
skip-changelog: Already updated

Signed-off-by: pep <pep@bouah.net>
2025-12-27 13:32:12 +01:00
Link Mauve
60bf821c63 jid: Fix JID parts serde deserialization
serde was bypassing the validation these types rely on, making them
completely unsound in an XMPP context.

Fixes #165.
2025-12-25 14:31:23 +01:00
Link Mauve
f1e5ac6ac8 xmpp-parsers: Make Priority’s inner i8 pub
We forgot to make it pub before, but should have.

This was a regression from 893a2f8e47,
when we converted it to xso.

Fixes #166.
2025-12-25 01:17:11 +01:00
Link Mauve
8c2b1df7f7 xmpp-parsers: Fix the type of jingle_rtp/ssrc to u32
XEP-0167 has been updated to version 1.2.3, to change the type of the
'ssrc' attribute to u32 (from String).  This is in accordance with
RFC 3550 (RTP), which defines it as a randomly-chosen 32-bit unsigned
integer.

Additionally, the docstring was completely wrong.
2025-12-03 12:26:30 +01:00
pep
e22daa91f1 xmpp: make Agent.config accessible only via getter
It may not matter much for the moment as this struct shouldn't change
very much during the life of the client, but this prevents the lock from
being held too long.

Signed-off-by: pep <pep@bouah.net>
2025-11-30 16:36:58 +01:00
pep
a1a31ce11c xmpp: Merge Agent configuration into new Config struct
Signed-off-by: pep <pep@bouah.net>
2025-11-30 16:36:58 +01:00
pep
147b79ca52 xmpp: new Config struct for Agent, with bookmarks_autojoin for now
Signed-off-by: pep <pep@bouah.net>
2025-11-30 16:36:58 +01:00
pep
77acd92c62 tokio-xmpp: Ignore missing "version" stream attribute for 0114 components
From the prosody@ room:
- 0114 doesn't mention the removal of @version on the stream, and it
  refers to 3920 which has it as a MUST.
- 0114 streams have historically never used @version="1.0"
- @version="1.0" implies stream features which 0114 doesn't have.
- There was a proposal years ago to fix this but a new XEP was preferred
  (0225).

The change here uses a compile-time check, and may have to change when
support for 0225 arrives if it's still gated behind the "component"
feature (even though it may be weird to have both under the same
feature). We'll see when we get there.

Signed-off-by: pep <pep@bouah.net>
2025-11-30 16:21:28 +01:00
Link Mauve
7715d2e2a3 Add a CI pass for typos 2025-11-22 21:48:21 +00:00
Link Mauve
5ed958582b Fix all typos using the typos tool
See https://github.com/crate-ci/typos
2025-11-22 21:48:21 +00:00