Commit graph

2175 commits

Author SHA1 Message Date
Jonas Schäfer
8238e81c66 Unify declaration of {Node,Domain,Resource}Part
This introduces a str-like type for each of these, which will allow
returning a ref instead of the copied data from various methods in
{Full,Bare}Jid.

The use of a macro ensures that all types are declared consistently.
2024-03-09 09:00:22 +01:00
Jonas Schäfer
e7fa6460f4 Update size tests
This seems to be related to an update of chrono. 32-bit sizes verified
using `cargo test --target i686-unknown-linux-gnu`.
2024-03-08 16:04:55 +01:00
Jonas Schäfer
2f7d5edb8a Make TryFrom<Element> chainable
This allows constructs like:

```rust
let residual = match Iq::try_from(stanza) {
  Ok(iq) => return handle_iq(..),
  Err(Error::TypeMismatch(_, _, v)) => v,
  Err(other) => return handle_parse_error(..),
};
let residual = match Message::try_from(stanza) {
  ..
};
let residual = ..
log::warn!("unhandled object: {:?}", residual);
```

The interesting part of this is that this could be used in a loop over a
Vec<Box<dyn FnMut(Element) -> ControlFlow<SomeResult, Element>>, i.e. in
a parsing loop for a generic XML/XMPP stream.

The advantage is that the stanza.is() check runs only once (in
check_self!) and doesn't need to be duplicated outside, and it reduces
the use of magic strings.
2024-03-03 14:50:29 +00:00
Jonas Schäfer
3b3a4ff0c8 Do not .clone() Element in code generated with generate_element
This should improve performance a little.
2024-03-03 15:05:11 +01:00
Jonas Schäfer
6f6f8abb53 Add fields for Result Set Management in disco#items
Note that this is a breaking change, as it changes the struct definition
and now requires additional fields when constructing the struct.
2024-03-03 14:54:30 +01:00
Emmanuel Gil Peyrot
1bab5c3cd9 Remove redundant imports
These became warnings in a recent nightly.

The TryFrom/TryInto imports were missed in
4089891f6c, but the rest are truly
redundant.
2024-02-27 22:57:18 +01:00
Emmanuel Gil Peyrot
6df8062867 Fix size tests on latest Rust release
Since Rust 1.76, and some much older nightly, there have been
improvements to the niche computation, which leads to smaller types
which can encode the same amount of data, variants, and such.

This fixes the tests on this compiler version.
2024-02-27 12:27:31 +01:00
Paul Fariello
1ecfaeb2bf Fix multiple error text lang handling in stanza_error 2024-02-27 08:53:19 +01:00
Werner Kroneman
87164b01ee Added xep-0264 to doap.xml 2024-02-08 16:07:41 +00:00
Werner Kroneman
78158edc3e Added jingle_thumbnails mod to lib.rs. 2024-02-08 16:07:41 +00:00
Werner Kroneman
611c09a8a2 Added jingle_thumbnails module. 2024-02-08 16:07:41 +00:00
Werner Kroneman
b541f8a809 Added ns::JINGLE_THUMBNAILS 2024-02-08 16:07:41 +00:00
famfo
b2ba646fd4 Implement empty before for QuerySet 2024-02-06 12:29:37 +01:00
99036735a3
xmpp: Rename ClientBuilder::new_with_server to new_with_connector
Some checks failed
Build / lint (push) Has been cancelled
Build / test-stable (push) Has been cancelled
Build / test-nightly (push) Has been cancelled
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2024-02-06 01:14:50 +01:00
famfo
a292e19314 Fix 32bit Qurey struct size 2024-02-05 22:19:22 +00:00
famfo
6daf0e906e Implement flip-page for MAM 2024-02-05 22:19:22 +00:00
099747f2e4 CONTRIBUTING: Split in categories
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2024-02-02 22:26:00 +01:00
xmpp ftw
2e0a90f447 CI: Deny future warnings
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2024-01-27 17:44:48 +00:00
xmpp ftw
9d5019ecdd Fix last cargo doc warnings
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2024-01-27 17:44:48 +00:00
famfo
28ab91f46a Add Sync to ServerConnectError 2024-01-27 17:26:07 +00:00
xmppftw
0949acb750 Update the MR docs base URL 2024-01-26 15:22:12 +01:00
xmppftw
b42b498a8b Parallel docs build ; don't doc deps ; push to docs.xmpp.rs 2024-01-25 17:24:20 +01:00
xmppftw
818a87802f Post comment to MR target not MR source project 2024-01-24 23:18:05 +01:00
xmppftw
5bf2ef12eb Generate docs on commits / MRs, upload to Gitlab Pages and post link in comment 2024-01-23 21:21:54 +01:00
famfo
060088be29 Implement function to get stream features 2024-01-23 16:09:07 +01:00
45c19690a8
README: Mention new CoC
Some checks failed
Build / lint (push) Has been cancelled
Build / test-stable (push) Has been cancelled
Build / test-nightly (push) Has been cancelled
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2024-01-22 15:20:50 +01:00
cad2e152cb
Code of Conduct
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
Heavily based on JoinJabber.org's CoC.

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2024-01-21 21:50:31 +01:00
xmppftw@kl.netlib.re
1ce8145a7d Fix unused variable warnings when avatars disabled 2024-01-21 13:55:39 +01:00
xmppftw@kl.netlib.re
25274e2f11 Deny warnings in github/gitea/forgejo CI and act local runner 2024-01-21 13:55:39 +01:00
xmppftw@kl.netlib.re
7fc46968be Deny warnings in gitlab CI 2024-01-21 13:55:39 +01:00
xmppftw@kl.netlib.re
a6f4600a19 Reexport hashes from parsers 2024-01-16 15:18:26 +01:00
Werner Kroneman
83d0d1bdfd Updated doap.xml for vCard avatars 2024-01-10 23:34:52 +01:00
Werner Kroneman
10b204093e Added vCard update to parsers 2024-01-10 23:34:50 +01:00
Werner Kroneman
c0cf672131 Added vCard avatars (XEP-0054) to parsers. 2024-01-10 21:50:34 +01:00
Werner Kroneman
18cb6f6e2d Refactored the "helpers" so that they use a common Codec trait; this makes them composable as well. 2024-01-10 19:49:53 +00:00
Werner Kroneman
e36b8d4fb9 Exposed bound_jid on Agent. 2024-01-10 17:12:59 +01:00
Emmanuel Gil Peyrot
3f90e84c5b xmpp-parsers: Add a hexadecimal codec
That one accepts both uppercase and lowercase hexadecimal input, and
outputs in lowercase.

It requires no separator between bytes, unlike ColonSeparatedHex.
2024-01-05 17:36:43 +01:00
moparisthebest
54de8d9951
Fix building xmpp with no-default-features 2024-01-03 20:01:05 -05:00
moparisthebest
019450ff4b
Add disabled-by-default insecure-tcp feature to tokio-xmpp for use by component connections 2024-01-03 19:34:03 -05:00
moparisthebest
38bfba4a18
xmpp crate now supports ServerConnector 2024-01-03 19:34:02 -05:00
moparisthebest
733d005f51
DNS/TLS deps are now optional, component now also uses ServerConnector 2024-01-01 02:09:41 -05:00
moparisthebest
e784b15402
ServerConnector and AsyncClient support channel binding, SimpleClient uses ServerConnector 2024-01-01 02:08:40 -05:00
moparisthebest
3cab603a4c
Add AsyncServerConnector to AsyncClient to be able to support any stream
Unfortunately API breaking unless we do some export mangling
2024-01-01 02:08:13 -05:00
xmppftw
3d9bdd6fe2 Add StanzaTimeInfo for <delay> (XEP-0203) 2023-12-31 21:07:12 +01:00
xmppftw
a21cd76b5d Run cargo fmt 2023-12-31 19:59:05 +01:00
xmppftw
4f8ce0a953 Implement Event::RoomSubject for room subject changes/retrieve 2023-12-31 19:41:34 +01:00
xmppftw
51f2462772 When IQ from field is not set, it's user's own bare JID 2023-12-31 18:01:30 +01:00
xmppftw
141a40bc79 Derive PartialOrd/Ord for Jid types 2023-12-31 16:59:21 +00:00
xmppftw@kl.netlib.re
e3fcdf1428 Move handling of MessageType::Chat to message::receive::chat module 2023-12-31 13:57:59 +01:00
xmppftw@kl.netlib.re
3ce259b143 Move handling of MessageType::GroupChat to message::receive::group_chat module 2023-12-31 13:57:59 +01:00