Commit graph xmpp-rs/tokio-xmpp
Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
bb02836097 Bump rxml to 0.14.0 2026-02-21 13:56:50 +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
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
famfo
f7931e95b6 tokio-xmpp: implicitly add bound_jid to IQs 2026-01-27 21:23:51 +00: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
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
5ed958582b Fix all typos using the typos tool
See https://github.com/crate-ci/typos
2025-11-22 21:48:21 +00:00
pep
0e7ac066d4 tokio-xmpp: Bump to 5.0.0
Signed-off-by: pep <pep@bouah.net>
2025-11-01 17:34:37 +01:00
pep
7a1dde7cfb parsers: Bump to 0.22.0
Signed-off-by: pep <pep@bouah.net>
2025-11-01 17:34:37 +01:00
pep
30b049a7d4 Bump xso to 0.3.0
Signed-off-by: pep <pep@bouah.net>
2025-10-28 13:06:51 +01:00
pep
db0ce5859b tokio-xmpp: Document TlsStream type behind 'ktls' feature
Signed-off-by: pep <pep@bouah.net>
2025-10-21 23:40:00 +02:00
pep
e526b49636 tokio-xmpp: Remove warning when rustls-any-backend feature isn't enabled
Signed-off-by: pep <pep@bouah.net>
2025-10-21 23:40:00 +02:00
lemonsh
468171517a
update changelogs 2025-10-12 22:20:29 +02:00
lemonsh
de564a53b0
use thiserror in tokio-xmpp and minidom 2025-10-12 00:31:48 +02:00
Jonas Schäfer
ccdf27117d Fix docs build with current nightly
skip-changelog, we don't officially support nightly.

See-Also: https://github.com/rust-lang/rfcs/pull/3631
See-Also: https://github.com/rust-lang/rust/pull/138907
2025-10-08 13:03:39 +02:00
Jonas Schäfer
3ffff2614a Bump xso version to 0.2.0 2025-09-17 20:03:18 +02:00
Maxime “pep” Buquet
653a10b170
tokio-xmpp: impl PartialEq on event::Stanza
skip-changelog: Stanza hasn't been in a release yet.

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2025-08-12 15:30:34 +02:00
Saarko
7c87d879d8 parsers: fix text field namespacing in StreamError
skip-changelog
2025-08-07 12:43:21 +00:00
Maxime “pep” Buquet
0ebc3ca04c tokio_xmpp/examples: Use server arg in echo_component
skip-changelog: not yet released? Not so much important anyway

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2025-08-07 12:08:07 +00:00
Maxime “pep” Buquet
9803546795
tokio-xmpp: Re-export xso::error::FromElementError
skip-changelog: code requiring xso hasn't been released yet

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2025-08-07 13:39:34 +02:00
Link Mauve
a58fb7e2f9 tokio-xmpp: Bump rustls-native-certs and webpki-roots
skip-changelog: This is just a dependency bump.
2025-07-28 15:20:01 +02:00
Link Mauve
e70dd957f4 tokio-xmpp: Bump hickory-resolver to 0.25 2025-07-28 14:59:11 +02:00
Link Mauve
c11075d1d4 tokio-xmpp: Bump rand to 0.9 2025-07-28 14:39:48 +02:00
Saarko
e3b167687f tokio-xmpp: remove code duplicates for direct tls and starttls connectors 2025-07-25 18:50:44 +02:00
Saarko
c674c14597 tokio-xmpp/client: add directTLS connection method 2025-07-25 18:50:30 +02:00
Maxime “pep” Buquet
02a70edf99
Fix 'elided lifetime' warning from nightly
Nightly 1.90. The fix passes on stable 1.88.

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2025-07-20 16:01:44 +02:00