Commit graph

2,546 commits

Author SHA1 Message Date
95b9526912 feat: vendored-openssl feature for xmpp crate 2026-06-23 17:09:29 +02:00
Jonas Schäfer
1710a6f99e Release all crates
Since we tie the versions rather tightly, we have to release the entire
bunch in order to allow people to upgrade to rxml 0.14.
2026-06-11 17:25:32 +02:00
Jonas Schäfer
a90d9fafb6 xso: fix build on no_std 2026-06-11 17:20:39 +02:00
Link Mauve
d0b28a94b0 Implement XEP-0463: MUC Affiliations Versioning 2026-06-11 13:23:18 +00:00
Link Mauve
59e803bd7e xmpp: Make bound_jid a FullJid 2026-06-11 15:07:31 +02:00
Link Mauve
d848b6efe7 tokio-xmpp: Make bound_jid a FullJid
That way we have fewer checks to make in client code.
2026-06-11 15:07:31 +02:00
Link Mauve
47c0edc3f6 xmpp-parsers: Optimize to_hex() a bit
Just one correctly-sized String allocation, instead of one String per
byte, a Vec<String>, and then a final String.

skip-changelog: Internal change.
2026-06-11 14:53:35 +02:00
Jonas Schäfer
09640de5f2 tokio-xmpp: save bound_jid and features in ClientWorker
This fixes a regression from 10f1b3663c
reported by @full-bars in a discussion on an unrelated issue [1].

skip-changelog, because the regression has not been released yet.

   [1]: https://gitlab.com/xmpp-rs/xmpp-rs/-/merge_requests/675#note_3445588227
2026-06-11 14:26:51 +02:00
abd9f7d136 feat: Component.jid is now a BareJid 2026-06-11 08:44:44 +02:00
O01eg
24ae2ffd73 xmpp-parsers: Add 'approved' attribute to roster item 2026-06-10 21:24:24 +00:00
Link Mauve
6b7195530b tokio-xmpp: Use Stanza from xmpp-parsers
The previous commit moved it from src/event.rs into xmpp-parsers, so now
we can use that type directly.
2026-06-10 17:59:26 +02:00
Link Mauve
0ef8c215d7 xmpp-parsers: Move the Stanza type from tokio-xmpp
It doesn’t come with the ensure_id() method, but otherwise this is a
much better location for it.
2026-06-10 17:59:26 +02:00
Link Mauve
e95313eedb xmpp-parsers: Simplify MucUser’s code
We can derive Default directly, and then implement new() based on it.

skip-changelog: Internal change.
2026-06-10 13:05:00 +02:00
Link Mauve
24cb246809 tokio-xmpp: Send the initial stream:stream in a single packet
Prosody would let the stream opening timeout if it receives it in more
than one TCP packet, which seems like a bug.

The behaviour was highly non-deterministic, a release build would almost
always (but not always) succeed to connect to a localhost Prosody, a
debug build would almost always (but not always) fail, and
RUST_LOG=trace would make any build fail to connect, as would strace.

My theory is that successful runs rely on the kernel merging all five
TCP packets in a single one, and any tracing would add sufficient delay
in-between to let it send every packet on its own.
2026-06-10 11:06:33 +02:00
Link Mauve
393feb8d5e jid: Add a failible DomainRef::with_node_str()
This matches BareJid::with_resource_str() in that it allows the user to
parse a &str into a NodePart and construct the BareJid in one call.
2026-06-09 21:44:50 +02:00
Jonas Schäfer
e72394c658 minidom: Bump version to 0.19.0
Signed-off-by: Jonas Schäfer <jonas@zombofant.net>
2026-06-09 18:00:34 +02:00
Jonas Schäfer
cc92d113fa stanzastream: handle malformed stanzas more gracefully
This introduces the FallibleStreamElement type which, instead of
failing parsing altogether, captures certain types of parse errors and
allows the user (in this case, the stanzastream) to react to these
errors appropriately.

This allows us to drop invalid stanzas (e.g. with malformed values in
strictly-checked fields) instead of failing the entire stream.

Fixes #172.
2026-06-06 15:35:18 +02:00
Jonas Schäfer
bda08407b0 xmlstream: remove T: AsXml bound from XmlStream type
While the FromXml bound is necessary for the key implementation of the
XmlStream (the `impl Stream`), the AsXml bound is not as intrinsic: the
Sink implementation can take any AsXml implementation on each separate
send invocation.

By removing this bound, we can add extra logic *only* to the parsing,
without having to worry about effects on the sending side.

Concretely, we'll be able to create a wrapper type for XmppStreamElement
which allows us to capture errors during parsing, without having to
worry about what happens during serialisation.
2026-06-06 14:11:55 +02:00
Jonas Schäfer
199218f263 stanzastream: start test suite 2026-06-06 14:04:01 +02:00
Jonas Schäfer
f78ea06bfb parsers: make inner pieces of bind.rs structs accessible 2026-06-06 14:04:01 +02:00
famfo
559159d458 tokio-xmpp: add option to set custom hickory resolver 2026-05-24 20:07:42 +00:00
famfo
8fe026cad3 tokio-xmpp: raise log level of IQ tracker 2026-05-24 17:07:56 +00:00
famfo
366f2c8349 tokio-xmpp: remove redundant pin from examples 2026-05-24 17:07:56 +00:00
famfo
10f1b3663c tokio-xmpp: add option to split client
Adds an option to split the `tokio-xmpp::Client` into a Sender and
Receiver. To enable this, a client worker is added which drives the
stream in the background.
2026-05-24 17:07:56 +00:00
famfo
d84cb261e4 tokio-xmpp: add StreamFeatures to Online event 2026-05-24 17:07:56 +00:00
famfo
8f03661acb tokio-xmpp: split StanzaStream into Sender and Receiver 2026-05-24 17:07:56 +00:00
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