Jonas Schäfer
37481fb8f6
parsers: do not do extensive XEP-0030 validation with disable-validation
...
Other additional checks are already gated by the absence of this
feature. As the MR to remove these checks altogether is still blocked,
this should serve as at least as an intermediate solution to anyone
affected by buggy remote implementations.
2024-04-28 10:48:35 +02:00
Jonas Schäfer
2e9c9411a3
jid: rewrite public types
...
This moves InnerJid into Jid and reformulates BareJid and FullJid in
terms of Jid.
Doing this has the key advantage that FullJid and BareJid can deref to
and borrow as Jid. This, in turn, has the advantage that they can be
used much more flexibly in HashMaps. However, this is (as we say in
Germany) future music; this commit only does the internal reworking.
Oh and also, it saves 20% memory on Jid objects.
Fixes #122 more thoroughly, or rather the original intent behind it.
2024-04-15 18:21:24 +02: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
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
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
9d5019ecdd
Fix last cargo doc warnings
...
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2024-01-27 17:44:48 +00:00
a6f4600a19
Reexport hashes from parsers
2024-01-16 15:18:26 +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
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
0a6ee5b32e
Support legacy integer <error> code. Don't expose it.
2023-12-22 12:26:28 +01:00
f9b71c8da0
Improve documentation
2023-12-16 17:29:00 +01:00
f1713231c4
Add Private XML Storage (XEP-0049) support for legacy bookmarks (XEP-0048 v1.0)
2023-12-16 17:28:13 +01:00
7a55608433
Document bookmarks2 module
2023-12-16 17:19:13 +01:00
d1b63a52a5
Add method to convert bookmarks::Conference to bookmarks2::Conference
...
Autojoin is now same struct in both modules
2023-12-16 17:19:13 +01:00
Maxime “pep” Buquet
4089891f6c
Update edition to 2021
...
- Remove TryFrom/Into and FromIterator imports
- Prevent impl_validator_using_provider macro in sasl crate from
constructing trait object
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2023-12-15 19:40:09 +00:00
Maxime “pep” Buquet
c8f312e89d
parsers/xhtml: keep iterating on all bodies
...
Revert part of b522eaf7f3 .
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2023-12-15 20:39:09 +01:00
Maxime “pep” Buquet
b522eaf7f3
parsers: clippy pass
...
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2023-12-15 19:26:06 +00:00
Werner Kroneman
a7ab45cb2d
Avatars can now be 32 bit sizes. (see https://xmpp.org/extensions/xep-0084.html ) size can be xs:unsignedInt
2023-12-03 16:38:14 +01:00
Maxime “pep” Buquet
2f47bdb1d3
parsers: Add TODO to remove superfluous exports from jid on next major release
...
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2023-10-26 17:46:42 +02:00
Maxime “pep” Buquet
3a0336bed0
parsers: re-export the jid module entirely
...
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2023-10-26 14:03:21 +02:00
Emmanuel Gil Peyrot
4460a59bc8
xmpp-parsers: XEP-0257: Correctly serialise no-cert-management
...
This element was previously always put in the generated element.
2023-09-05 17:08:30 +02:00
Emmanuel Gil Peyrot
c7887efbc7
xmpp-parsers: Fix size tests on 32-bit
2023-06-20 18:59:26 +02:00
Emmanuel Gil Peyrot
91736ec0ed
xmpp-parsers: Fix size tests on 64-bit
2023-06-20 18:59:26 +02:00
Emmanuel Gil Peyrot
022a920300
xmpp-parsers: Update to the new jid crate
2023-06-20 18:59:26 +02:00
Maxime “pep” Buquet
f9d4419513
parsers: Document new MucUser helpers
...
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2023-06-07 19:17:06 +02:00
Maxime “pep” Buquet
9fa8a9f6ba
parsers: Rename MucUser::with_status to with_statuses
...
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2023-06-07 19:16:55 +02:00
Maxime “pep” Buquet
b8ba74e336
parser: Add helpers on MucUser
...
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2023-06-07 18:44:37 +02:00
Maxime “pep” Buquet
d0ec8739d5
parsers: impl MessagePayload for MucUser
...
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2023-06-07 16:54:20 +02:00
Maxime “pep” Buquet
6cd4addc1a
parsers: Add with_payload/with_payloads helpers on Message
...
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2023-06-07 16:49:19 +02:00
c8dcf5e7a7
Fix expected struct sizes for nightly optimizations (no more CI warnings)
2023-06-06 09:37:16 +00:00
6fa6deddcb
Message now has constructors for each type, and a with_body builder method ( #78 )
2023-06-03 12:39:55 +02:00
512c1d1aae
Presence now has constructors for each type variant, and a with_payload builder method ( closes #79 )
2023-06-03 08:59:19 +00:00
Maxime “pep” Buquet
e8a7d909c1
parsers: derive PartialEq on Iq too
...
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2023-05-30 19:04:33 +02:00
Emmanuel Gil Peyrot
2955a0fe60
parsers: Bump base64
...
Version 0.21 replaced base64::decode() with an Engine trait and multiple
structs implementing it for various alphabets, various performance
profiles, etc. It is slightly longer to import but in the end does the
very same thing.
2023-04-03 11:28:41 +02:00
Emmanuel Gil Peyrot
6bd407605b
xmpp-parsers: Add Message Reactions (XEP-0444) support
2022-12-30 15:26:37 +01:00
Maxime “pep” Buquet
a0e6054eb8
parsers: Update IETF URLs in documentation
...
sed -i -e 's/tools\.ietf\.org\/html/www\.rfc-editor\.org\/rfc/' src/**.rs
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2022-12-27 17:36:19 +01:00
Maxime “pep” Buquet
afcf9fb2d0
parsers: correct cargo doc warnings
...
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2022-12-27 17:36:19 +01:00
Maxime “pep” Buquet
f4084bcc83
parsers: with_ helpers for muc::user::Item
...
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2022-12-27 17:36:19 +01:00