Commit graph xmpp-rs/xmpp
Author SHA1 Message Date
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
Adrien Destugues
0cf06f0caf xmpp: Allow <confirm/> in message with empty body
skip-changelog: bugfix for previous not yet released change
2025-09-12 14:00:00 +02:00
Maxime “pep” Buquet
3e794d3f50 xmpp: extend escape-hatch feature to the receiving part
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2025-09-01 17:37:07 +00:00
Maxime “pep” Buquet
fbdd5f7b54 xmpp: document 'escape-hatch' feature
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2025-09-01 17:37:07 +00:00
PulkoMandy
2c81b6d96f xmpp: Add XEP-0070 authentification support 2025-08-29 11:40:25 +00:00
Jonas Schäfer
dc8c3eac4c parsers: port Iq to use the derive macros 2025-05-13 12:01:21 +00:00
dae6e49cce
Add more documentation
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2025-05-12 02:27:03 +02:00
Maxime “pep” Buquet
5d6759caa1 xmpp: Move single changelog entry to breaking
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2025-05-11 20:25:04 +00:00
Jonas Schäfer
fc8b581593 Clean up tls-related feature flags
This provides a clear and consistent interface for selecting TLS-related
features on both (xmpp and tokio-xmpp) crates. All feature checks have
been revamped. All working combinations have been tested (including a
connectivity test + --all-features docs build) using:

```
set -xeuo pipefail
features=(aws_lc_rs ring ktls,aws_lc_rs ktls,ring aws_lc_rs,ring aws_lc_rs,ring,ktls native-tls rustls-any-backend)
export RUSTFLAGS=" -D warnings"
cargo test --no-default-features
cargo test
for feature in ${features[@]}; do
  echo ">>> BUILDING with $feature" 2>&1
  # Running code or building examples cannot succeed with rustls-any-backend.
  features="starttls,$feature"
  if [ "$feature" != 'rustls-any-backend' ]; then
    if ! cargo test --no-default-features --features="$features"; then
      echo ">>> BUILD FAILED for tls feature set: $features" >&2
      exit 1
    fi
    set +e
    timeout -sINT -p -k 2 3 cargo run --no-default-features --features="$features" --example keep_connection -- test@hub.sotecware.net "$(pass xmpp/test@hub.sotecware.net)"
    status="$?"
    set -e
    if [ $status -ne 0 ]; then
      echo ">>> keep_connection did not shut down cleanly! (status: $status)" >&2
      exit 1
    fi
  else
    if ! cargo build --no-default-features --features="$feature"; then
      echo ">>> BUILD FAILED for tls feature set: $features" >&2
      exit 1
    fi
  fi
done
RUSTDOCFLAGS="--cfg docsrs" RUSTFLAGS="--cfg xmpprs_doc_build" cargo +nightly doc -Zrustdoc-map --all-features
```
2025-05-10 22:02:39 +02:00
Jonas Schäfer
4e9e18444c Avoid enabling multiple rustls backends by accident
For this, we had to:

- Make the choice(s) of backend explicit in tokio-xmpp features
- Avoid picking a backend through transitive dependencies in xmpp
  (reqwest->hyper->rustls).

In addition, we choose the default rustls backend by default and adapt
the examples so that they can cope with either situation.
2025-05-10 11:39:21 +02:00
Maxime “pep” Buquet
4346e4b940 xmpp::muc::room: reverse check for rooms_joined
skip-changelog, fixes bug introduced in the same release

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2025-04-27 16:28:02 +02:00
Maxime “pep” Buquet
477af3c895 xmpp: new 'escape-hatch' feature
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2025-04-20 13:41:56 +00:00
Jonas Schäfer
5172fb5e0f parsers: port Message to use the derive macros 2025-04-18 12:56:03 +02:00
Maxime “pep” Buquet
da219d4fed
xmpp: handle SIGINT (^C) in hello_bot example
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2025-04-13 21:16:17 +02:00
Maxime “pep” Buquet
4780f89604 xmpp: new Agent::new method
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2025-04-07 18:26:27 +00:00
Link Mauve
5ae38545e4 xmpp: Shorten the default caps node to our main domain
We do own xmpp.rs, so let’s use that instead of gitlab.com.
2025-04-07 11:57:01 +02:00
Emmanuel Gil Peyrot
fa61f421bb xmpp-parsers: Use xso for pubsub events
Also split the PubSubEvent enum into Event and Payload.
2025-01-27 15:07:59 +01:00
Emmanuel Gil Peyrot
543d9eb590 xmpp-parsers: Convert http_upload::Header to xso
We can’t use generate_attribute!() for HeaderName because it has to be
case insensitive.
2025-01-27 14:45:17 +01:00
Emmanuel Gil Peyrot
f63b780089 xmpp-parsers: Simplify PubSub Item using xso
Now that we can have a single arbitrary payload, we can derive FromXml
and AsXml on the Item.
2025-01-26 16:40:05 +00:00
33098e6f2c Message and message_correct::Replace now has typed Id 2024-12-30 20:50:43 +00:00
Maxime “pep” Buquet
bbbf522ca0
CI: Force changelog updates
Changelog updates are now required in MRs by default. If there is a
match for "\<skip.\?changelog\>" in the commit message, this will be
ignored.

$CI_COMMIT_MESSAGE mangles newlines so it's not possible to require the
string to be on its own line, that means it would also trigger within a
wall of text, which makes it less obvious.

Also, I wasn't able to find a CI variable which has the ref of the
branch the MR is set against, to build a tree-ish than spans over the
whole MR and not just HEAD.

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2024-12-24 11:12:55 +01:00
bfac3e8893 xmpp: Receive message corrections, unchecked 2024-12-20 15:48:47 +00:00
Maxime “pep” Buquet
2e66f848f6
xmpp: Remove noisy info log
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2024-12-20 14:23:38 +01:00
668cc05445 xmpp: Replace std stuff with alloc/core stuff 2024-12-19 20:39:18 +01:00
c1a3c85556 xmpp: Implement Deref<Target=ResourcePart> for RoomNick 2024-12-18 21:55:03 +01:00
793b76d0d5 xmpp: More nicks are typed as RoomNick 2024-12-18 21:55:01 +01:00
48cb79b2d1 xmpp: Implement FromStr for RoomNick 2024-12-18 21:26:30 +01:00
b8f74e6bce xmpp: Common structure for imports 2024-12-18 19:26:40 +01:00
0ec9103b28 xmpp: Rewrite other messages with Agent::send_raw_message 2024-12-18 19:18:34 +01:00
b4d3252da4 xmpp: Add Agent::send_raw_message 2024-12-18 19:18:22 +01:00
e19a7988ed xmpp: Agent::send_message is only for normal messages 2024-12-18 19:17:55 +01:00
d98ed615a5 xmpp: Agent::send_room_private_message takes RoomPrivateMessageSettings 2024-12-18 19:17:39 +01:00
7991cef904 Add tests for crate exports ; add structure to imports/exports 2024-12-18 18:03:18 +00:00
3fd8285a29 xmpp: RoomNick is newtype wrapper for ResourcePart 2024-12-18 15:43:09 +00:00
5477cf1240 xmpp: Use ResourcePart for sender of room events 2024-12-18 15:43:09 +00:00
c16456f381 parsers/xmpp: MUC bookmarks have nickname typed as ResourcePart 2024-12-18 15:43:09 +00:00
Jonas Schäfer
35ce86243f client: use stanzastream! 2024-12-17 18:16:02 +01:00
8c3c8c7c97 hello_bot accepts a list of room JIDs to join to say hello 2024-12-17 00:27:50 +00:00
fdec34afde Add JoinRoomSettings, LeaveRoomSettings, and RoomMessageSettings 2024-12-17 00:27:50 +00:00
6d7a95b6ca Remove xmpp::Event::{JoinRoom,LeaveRoom,LeaveAllRooms} 2024-12-16 22:36:25 +01:00
Emmanuel Gil Peyrot
011585594f xmpp: Adapt to xmpp-parsers changes wrt autojoin
This attribute is now a simple bool instead of an enum.
2024-12-16 13:32:49 +00:00
Jonas Schäfer
4cfe4f8429 xmlstream: implement simple timeout logic
This allows to detect and handle dying streams without getting stuck
forever.

Timeouts are always wrong, though, so we put the burden of choosing the
right values (mostly) on the creator of a stream.
2024-09-01 10:02:36 +02:00
Jonas Schäfer
ab10e30ac0 Port crates to use new XSO-based xmlstream 2024-08-29 16:47:13 +02:00
df106dfbaf Relative dependencies 2024-08-12 10:39:09 +00:00
0b58561003 Rename AsyncClient to Client 2024-08-10 16:57:51 +02:00
311e7406f0 Make Client and Component more unified, and connectors too 2024-08-10 16:57:49 +02:00
ec3c7694a7 Moved starttls connector to tokio_xmpp::connect::starttls module 2024-08-10 16:49:26 +02:00
23e943825f xmpp::Agent::wait_for_events cannot error 2024-08-08 15:43:52 +02:00
ba6a7c4744 Use tokio::sync::RwLock instead of std 2024-08-06 16:04:04 +02:00
fa99c09585 Indicate which feature flag for each module/type 2024-08-05 11:14:41 +02:00