Commit graph

2,529 commits

Author SHA1 Message Date
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
Link Mauve
b014316206 Add a typos.toml file
This file lists the files to ignore, as well as the words to ignore.
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
e503f016a3 xmpp: update to edition 2024
Signed-off-by: pep <pep@bouah.net>
2025-11-13 22:41:05 +01:00
pep
4a054ae802 CONTRIBUTING.md: Making a release
skip-changelog.

Signed-off-by: pep <pep@bouah.net>
2025-11-07 21:48:28 +00:00
pep
239a019174
jid: Bump to 0.12.1
Signed-off-by: pep <pep@bouah.net>
2025-11-02 01:28:30 +01: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
e95f884e44 parsers: clippy
Signed-off-by: pep <pep@bouah.net>
2025-11-01 16:30:22 +01:00
pep
00b638fc38 xso{,-proc}: clippy
This doesn't fix all of the clippy warnings in these crates. There are
decisions that needs to be made in there that I'm not willing to make.

Signed-off-by: pep <pep@bouah.net>
2025-11-01 16:30:22 +01:00
pep
9595ffe2c2
minidom: clippy
Signed-off-by: pep <pep@bouah.net>
2025-11-01 16:30:17 +01:00
pep
d60f718955
xmpp/example: Use unwrap instead of ignoring Result
skip-changelog.

Co-authored-by: Link Mauve <linkmauve@linkmauve.fr>
Signed-off-by: pep <pep@bouah.net>
2025-10-29 13:48:42 +01:00
pep
21cb5c1f7f
xmpp/example: explicit types to prevent mishap
Previously there was a forgotten `.await` at this exact place because of
the `let _`, which could have been `let _: type` to prevent this. The
`handle_events` method here returns the unit type so I just removed it.

skip-changelog: already in the changelog and not released yet

Signed-off-by: pep <pep@bouah.net>
2025-10-29 13:06:47 +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
f0d660315f
xmpp/example: .await event handling in hello_bot
skip-changelog.

Signed-off-by: pep <pep@bouah.net>
2025-10-24 01:50:56 +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
pep
d91e99f170 minidom: re-export rxml
As it's now being used in Element::attr and ElementBuilder::attr

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
48f67d034e minidom: Remove 'std' feature
The parser being used from rxml, `rxml::RawParser`, requires std, so it
doesn't make sense.

Signed-off-by: pep <pep@bouah.net>
2025-10-21 23:40:00 +02:00
Maxime “pep” Buquet
e9bdae8808 minidom: add copyright header
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2025-10-21 23:40:00 +02:00
Maxime “pep” Buquet
2678ac1b97 minidom: deduplicate from_reader methods
skip-changelog: internal stuff

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2025-10-21 23:40:00 +02: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
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
pep
4faa151120 CI: set CARGO_TERM_COLOR: always
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
83635e6077 Move docs host once more
This new host only supports rsync-over-ssh, which means that we need to
use rsync-protocol syntax (`::` instead of `:` to separate host and
path), use a module name in front of the path (`www`) and explicitly
request ssh (`--rsh=ssh`).

skip-changelog, build infra change only.
2025-10-08 13:20:12 +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
5ab4f395e0 Bump xso_proc version to 0.2.0
skip-changelog, we do not keep a dedicated changelog for xso-proc.
2025-09-17 19:29:39 +02:00
Jonas Schäfer
ff9c3dc88c Bump minidom version to 0.17.0 2025-09-17 19:15:41 +02:00
Jonas Schäfer
5b265eb302 Move to another docs host
skip-changelog, no user-visible change.
2025-09-17 18:54:14 +02:00
Maxime “pep” Buquet
948a1a3c16 CONTRIBUTING: Add clause against capitalism
Thanks again GoToSocial's stub CoC.
9b7db51436/CODE_OF_CONDUCT.md

skip-changelog.

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2025-09-17 01:06:02 +02:00
Maxime “pep” Buquet
ccc7187e3a CONTRIBUTING: Add clause against "AI"
In quotes, because AI generally means a lot more than what people use
the word for nowadays.

Copied straight from GoToSocial's stub code of conduct.

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2025-09-17 01:06:02 +02:00
Maxime “pep” Buquet
03c7310990 xmpp: Stop proxying tokio-xmpp event in escape-hatch, add our own variants
This was causing issues with Clone-ing tokio-xmpp Event-s as they
include Error-s which are typically not Clone-able. Event and Stanza
aren't Clone-able either so might as well do our own stuff here.

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2025-09-16 22:57:17 +00:00