Commit graph xmpp-rs/parsers
Author SHA1 Message Date
Jonas Schäfer
f78ea06bfb parsers: make inner pieces of bind.rs structs accessible 2026-06-06 14:04:01 +02: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
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
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
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
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
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
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
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
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
Link Mauve
3eb8a2ae11 xmpp-parsers: Run rustfmt
Sorry, I made a mistake and pushed directly to main. T_T
2025-11-22 22:47:20 +01:00
Link Mauve
9b77b968a9 xmpp-parsers: Simplify with String::split_once() instead of splitn(2)
This directly returns a 2-uple, instead of a Vec which has to be matched
again as if we didn’t know it would return up to two elements.
2025-11-22 22:40:53 +01:00
Link Mauve
4d1838d6cc xmpp-parsers: Use ToString::to_string as a map() argument
It’s more readable than using a closure for the same thing.
2025-11-22 22:20:06 +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
e95f884e44 parsers: clippy
Signed-off-by: pep <pep@bouah.net>
2025-11-01 16:30:22 +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
bd986f5e5e minidom: Bump version to 0.18
Signed-off-by: pep <pep@bouah.net>
2025-10-28 13:06:51 +01:00
Link Mauve
0c253b8c4e xmpp-parsers: Deny more warnings lib-wide
All warnings denied in macro tests can actually be denied in the whole
crate.
2025-10-25 18:38:45 +02:00
pep
15ac51829f minidom: loosen type requirement on Element::attr{,_ns} getters
Signed-off-by: pep <pep@bouah.net>
2025-10-22 18:51:42 +02:00
Maxime “pep” Buquet
19865e5f1e minidom: breaking: Allow getting Element attributes by namespace
- Move Element.attributes to `AttrMap`, slowly using rxml's features and
  unrolling our own.
- Add Element::attr_ns that requires the attribute namespace.
  Element:attr defaults to rxml::Namespace::none() but the interface
  changes nonetheless for a &NcNameStr. Similar changes on
  `ElementBuilder` methods.
- Remove iterator structs for attributes, return a ref on the AttrMap
  directly as we don't need to keep attributes' internals hidden
  anymore.
- Enable rxml's `macros` feature within tests to access the `xml_ncname`
  macro.

Signed-off-by: pep <pep@bouah.net>
2025-10-22 18:51:39 +02:00
pep
7d47173318 parsers/stanza_error: fix tests behind 'component' feature
Signed-off-by: pep <pep@bouah.net>
2025-10-21 23:40:00 +02:00
pep
061ccecb3f parsers: get_best_body test: Add missing @xml:lang under component feature
Signed-off-by: pep <pep@bouah.net>
2025-10-21 23:40:00 +02:00
pep
e7845d0fbc parsers: gate unused import
Signed-off-by: pep <pep@bouah.net>
2025-10-21 23:40:00 +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
Jonas Schäfer
ff9c3dc88c Bump minidom version to 0.17.0 2025-09-17 19:15:41 +02:00
Link Mauve
9d91b02dfd Revert "xmpp-parsers: Remove optional child from sm element"
This reverts commit 0a1b291574 once again.

This is currently required to connect to Prosody, otherwise the parser
will choke on the extra undocumented child.

I still wonder if required (4e0cd5d96b)
would be useful to support then, as it might also be found in the wild.
2025-09-08 11:37:24 +02:00
PulkoMandy
155ad9b670 parsers: Add Confirm from XEP-0070 2025-08-29 11:40:25 +00:00
PulkoMandy
1052aaf010 parsers: fix documentation typo 2025-08-29 11:40:25 +00:00
Link Mauve
0a1b291574 xmpp-parsers: Remove optional child from sm element
When the required child was added and subsequently reverted, it was
noted that optional and required were never defined, and only appeared
in old XEP-0198 examples.  The XEP has been fixed already[1].

This basically reverts 0f0759b207.

[1] https://github.com/xsf/xeps/pull/1447
2025-08-29 12:48:55 +02:00
Maxime “pep” Buquet
621c5882cf
parsers: re-export xso::error::FromElementError
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2025-08-14 15:24:09 +02:00
Saarko
7c87d879d8 parsers: fix text field namespacing in StreamError
skip-changelog
2025-08-07 12:43:21 +00:00
Jonas Schäfer
59af49c691 xso-proc: provide FromXml::xml_name_matcher on derived impls
That way, derived implementations can also make use of the performance
benefits.
2025-07-13 11:10:51 +00:00
Jonas Schäfer
1262b560e9 Fix parsing of stream errors
skip-changelog, because there's no release with the stream_error module
yet.
2025-07-13 12:53:43 +02:00
Jonas Schäfer
e438813fb2 tokio_xmpp: properly process <stream:error/> while waiting for features
Before this, a stream error would not be readable by user code, as the
`recv_features()` function would not even attempt to parse it. This
change allows application code to react to stream errors which are
received before stream features are received.

skip-changelog, because there's no release with the xmlstream module
yet.
2025-07-13 12:53:43 +02:00
Jonas Schäfer
af7e47a791 Add changelog entry for starttls nonzas
They have been added in 54e1a98cd already.
2025-07-09 17:18:31 +02:00
Jonas Schäfer
c229ab0127 Add support for <failure xmlns=starttls/>
Specified in RFC 6120 §5.4.2.2
2025-07-09 17:18:13 +02:00