Commit graph

2265 commits

Author SHA1 Message Date
97fdeea941
CI: Force changelog updates
Some checks are pending
Build / lint (push) Waiting to run
Build / test-stable (push) Blocked by required conditions
Build / test-nightly (push) Blocked by required conditions
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-23 12:03:03 +01:00
xmppftw
491264fe00 jid: serde support for JID parts 2024-12-20 13:06:05 +00:00
Jonas Schäfer
58698f633f xso: only take reference in transform
This avoids the need for an expensive clone. Since we switched to AsXml
instead of IntoXml, we don't necessarily have to clone the data when
building new elements, only when it's absolutely necessary. The clones
then happen implicitly in the ItemToEvent iterator used internally.

This mostly fixes #86, with the caveat that there's no absolutely cheap
test: On success, the entire element will be copied, while on failure,
you learn about it rather quickly.
2024-12-20 12:44:43 +01:00
xmppftw
9901141b5f parsers: Rename Message::get_best_owned to get_best_cloned 2024-12-20 00:29:03 +01:00
xmppftw
5bc94dce95 tokio_xmpp: Replace std::io calls with use std::io 2024-12-19 20:51:57 +01:00
xmppftw
67442bfa0b minidom: Replace std::io calls with use std::io 2024-12-19 20:51:57 +01:00
xmppftw
c8d3c068e0 xso: Replace std::io calls with use std::io 2024-12-19 20:51:57 +01:00
xmppftw
6a662e6a2c xso: Replace std stuff with alloc/core stuff 2024-12-19 20:51:57 +01:00
xmppftw
4e5f0bc961 xso-proc: Replace std stuff with alloc/core stuff 2024-12-19 20:51:56 +01:00
xmppftw
4ac792b4d4 jid: Replace std stuff with alloc/core stuff 2024-12-19 20:47:08 +01:00
xmppftw
3ebc30c7ab minidom: Replace std stuff with alloc/core stuff 2024-12-19 20:47:07 +01:00
xmppftw
087534be1e parsers: Replace std stuff with alloc/core stuff 2024-12-19 20:45:38 +01:00
xmppftw
1ce2f894aa tokio_xmpp: Replace std stuff with alloc/core stuff 2024-12-19 20:45:36 +01:00
xmppftw
668cc05445 xmpp: Replace std stuff with alloc/core stuff 2024-12-19 20:39:18 +01:00
xmppftw
1c1b960265 xso: Add std feature ; default-features compiles in no-std 2024-12-19 20:38:28 +01:00
xmppftw
6e3f31ef46 parsers: Add get_best_{body,subject}_owned methods for Message 2024-12-19 17:46:01 +01:00
xmppftw
50425617b5 parsers: Add Message::extract_valid_payload helper 2024-12-19 17:36:10 +01:00
xmppftw
c1a3c85556 xmpp: Implement Deref<Target=ResourcePart> for RoomNick 2024-12-18 21:55:03 +01:00
xmppftw
793b76d0d5 xmpp: More nicks are typed as RoomNick 2024-12-18 21:55:01 +01:00
xmppftw
48cb79b2d1 xmpp: Implement FromStr for RoomNick 2024-12-18 21:26:30 +01:00
Emmanuel Gil Peyrot
f8347165fd tokio-xmpp: Add forgotten ChangeLog entry for ktls support 2024-12-18 18:33:42 +00:00
xmppftw
b8f74e6bce xmpp: Common structure for imports 2024-12-18 19:26:40 +01:00
xmppftw
0ec9103b28 xmpp: Rewrite other messages with Agent::send_raw_message 2024-12-18 19:18:34 +01:00
xmppftw
b4d3252da4 xmpp: Add Agent::send_raw_message 2024-12-18 19:18:22 +01:00
xmppftw
e19a7988ed xmpp: Agent::send_message is only for normal messages 2024-12-18 19:17:55 +01:00
xmppftw
d98ed615a5 xmpp: Agent::send_room_private_message takes RoomPrivateMessageSettings 2024-12-18 19:17:39 +01:00
Emmanuel Gil Peyrot
897c2abe0b tokio-xmpp: Refactor to provide channel-binding for ktls
Instead of having a second method to fetch channel-binding from the
TlsStream, do it directly in the connect() method, since after that we
don’t have enough information to fetch it any longer when using ktls.
2024-12-18 18:05:36 +00:00
xmppftw
7991cef904 Add tests for crate exports ; add structure to imports/exports 2024-12-18 18:03:18 +00:00
Emmanuel Gil Peyrot
1b4a307919 xmpp-parsers: Convert DiscoInfoResult to xso
This disables some tests, but those were controversial anyway.

I was thinking about replacing the Feature struct with a plain String,
what do you think about it?
2024-12-18 18:50:50 +01:00
Emmanuel Gil Peyrot
893a2f8e47 xmpp-parsers: Convert Presence to xso
The two remaining issues, which led to two ignored tests, are that
priority now gets always serialized, and that we don’t reject duplicated
identical xml:lang in statuses.
2024-12-18 15:49:06 +00:00
xmppftw
3fd8285a29 xmpp: RoomNick is newtype wrapper for ResourcePart 2024-12-18 15:43:09 +00:00
xmppftw
5477cf1240 xmpp: Use ResourcePart for sender of room events 2024-12-18 15:43:09 +00:00
xmppftw
c16456f381 parsers/xmpp: MUC bookmarks have nickname typed as ResourcePart 2024-12-18 15:43:09 +00:00
xmppftw
8c033a3fa0 xso: Implement FromXmlText and AsXmlText for NodePart,DomainPart,ResourcePart 2024-12-18 15:43:09 +00:00
Emmanuel Gil Peyrot
3c77ee0cc7 xmpp-parsers: Add support for <alternative-session><sid/></>
This was previously unimplemented due to how the enum was treated, now
that we moved the reason element to xso we can describe it properly and
thus implement everything it supports.

This causes one regression on xml:lang validation, but we can live with
that until xso implements such verification.
2024-12-18 16:08:24 +01:00
Jonas Schäfer
7074344834 xso: correctly handle I/O errors during start event in from_reader
Without this, it'd panic, which is "not ideal", as they say.
2024-12-18 14:47:08 +00:00
Emmanuel Gil Peyrot
cd43aa2fcb xmpp-parsers: Convert the Actor enum into a struct
XEP-0045 doesn’t specify what to do in the case the actor contains both
a @jid and a @nick, so let’s not encode anything special about that
here.

In addition this converted it to use xso.

Supersedes !196.

Fixes #88.
2024-12-17 18:20:52 +01:00
Jonas Schäfer
ce57ee4b38 tokio_xmpp: add example to demonstrate stream management 2024-12-17 18:16:02 +01:00
Jonas Schäfer
35ce86243f client: use stanzastream! 2024-12-17 18:16:02 +01:00
Jonas Schäfer
80f899daa0 tokio_xmpp: implement high-level, resilient stanza stream 2024-12-17 18:16:02 +01:00
Jonas Schäfer
56ce57ecde xmlstream: use Stanza for XmppStreamElement
Oftentimes, Stanza is at hand anyway, so this saves some typing.
2024-12-17 16:12:56 +01:00
Jonas Schäfer
c6f928d5c8 xmlstream: make sink implementation generic
This allows to use any serialisable type. The advantage is that moves
and clones are avoided (which would otherwise be needed to construct
e.g. a XmppStreamElement from a Stanza or Message).
2024-12-17 16:12:56 +01:00
Jonas Schäfer
519718d9b5 xmlstream: add support for boxing the transport
This is useful in situations where we don't want to care about the
specific type of the underlying transport.
2024-12-17 16:12:56 +01:00
Jonas Schäfer
2388f23b4e xmlstream: support receiving stream errors 2024-12-17 16:12:56 +01:00
xmppftw
8c3c8c7c97 hello_bot accepts a list of room JIDs to join to say hello 2024-12-17 00:27:50 +00:00
xmppftw
fdec34afde Add JoinRoomSettings, LeaveRoomSettings, and RoomMessageSettings 2024-12-17 00:27:50 +00:00
Emmanuel Gil Peyrot
7fca02958b xmpp-parsers: Fix jingle thumbnails wrt the XEP changes
Version 0.4.2 added a restriction on width and height to be in the
0..65535 range.  The media-type attribute has always been optional as
well.
2024-12-17 00:27:15 +01:00
xmppftw
6d7a95b6ca Remove xmpp::Event::{JoinRoom,LeaveRoom,LeaveAllRooms} 2024-12-16 22:36:25 +01:00
Jonas Schäfer
fa039c588b xso: improve wording in AsXmlText and AsOptionalXmlText 2024-12-16 19:04:23 +01:00
xmppftw
580fdeffa9 Added a test for prosody bug 1664 workaround 2024-12-16 15:19:54 +00:00