Commit log

33c8f07 Disable bot comment for now

Click to expand commit body
It is broken because of an expired token and the fix doesn't seem to be
trivial, so we disable it for now so that the pipelines become green
again.

skip-changelog, this is not a code change.

Jonas Schäfer created

86b65ab xmpp-parsers: Split vCard-temp iq get into new VCardQuery

Click to expand commit body
There is no reason to force users to use the same struct for both.

Emmanuel Gil Peyrot created

0adca16 xmpp-parsers: Don’t use anything from std

Click to expand commit body
The remaining two were core::str::FromStr and
alloc::collections::BTreeMap.

Note that this doesn’t allow us to be no_std yet.

skip-changelog: This isn’t in any way user-visible, except that some
structs are now slightly smaller.

Emmanuel Gil Peyrot created

fefc898 xso-proc: Allow #[xml(flag)] without params

Click to expand commit body
The namespace defaults to the parent’s namespace, and the name to the
field name, so we can avoid needlessly duplicating that info.

Emmanuel Gil Peyrot created

244a9bb xmpp-parsers: Switch from zero-sized types to #[xml(flag)]

Click to expand commit body
That way we can simply use true/false, instead of
Some(TheZeroSizedType)/None.

Emmanuel Gil Peyrot created

330b216 parsers: add support for mediated invite syntax

Jonas Schäfer created

c0e45b6 xmpp-parsers: Migrate Caps to xso

Click to expand commit body
The hash member has been split into a hash and a ver members, to reflect
the attributes.

Emmanuel Gil Peyrot created

01a0c51 xso-proc: Add support for the codec field on attribute meta

Click to expand commit body
This allows a custom TextCodec to be used for encoding and decoding the
attribute’s value, instead of FromXmlText and AsOptionalXmlText.

Emmanuel Gil Peyrot created

763a603 xso: fix documentation typos

Click to expand commit body
skip-changelog

Jonas Schäfer created

fc62229 tokio_xmpp: fix Client on servers without Stream Management

Click to expand commit body
The Client::send_stanza method blocks on the stanza actually being sent
over the stream. Without this change, the method will never return
on streams without XEP-0198 Stream Management because `sm_state` is
then None and thus the StanzaToken's state is never advanced: it would
be stuck in Queued state.

In addition, a lack of advancement to Sent state may cause a deadlock on
XEP-0198-enabled streams if data is received so fast that the
frontend_tx mpsc::Sender in the stanzastream::Worker is filled up. In
such a case, the Worker cannot obtain a permit and will only service
writes. However, that will mean that no StanzaTokens can be advanced
beyond Queued state, because for that, reads need to be serviced (to
receive the SM acks).

If a burst of stanzas is then received while Client::send_stanza is
being awaited, send_stanza can only return if something reads from the
frontend mpsc in the meantime. We do not want to require user code to
drive the Client in full-duplex mode, hence this is a bug.

skip-changelog, because this fixes an unreleased feature.

Jonas Schäfer created

07f3dc4 xmpp-parsers: Fix vCard-temp test

Click to expand commit body
xso::text::TextCodec is now generic on base64::Engine, which causes a
base64 engine to have two encode() methods, needing to disambiguate
them.

Emmanuel Gil Peyrot created

4c9a271 xso: remove incorrect/obsolete comment

Jonas Schäfer created

6978756 xso: implement TextCodec<_> on all T: base64::engine::Engine

Click to expand commit body
The `xso::text::Base64` struct remains as a shorthand (because frankly,
I find the const names in the base64 crate very unwieldly), but you can
now use any of the base64 engines as codec.

Jonas Schäfer created

9577350 xso-proc: improve error message on type mismatch for extracted fields

Click to expand commit body
The case this affects is a field like:

```
struct Foo {
   #[xml(extract(fields(text(type_ = String)), namespace = .., name = ..))]
   foo: ServiceType,
}
```

Before, we get this:

```
error[E0631]: type mismatch in closure arguments
    --> muchopper/libmuchopper/src/xmpp/sjn_api.rs:188:10
     |
188  | #[derive(AsXml)]
     |          ^^^^^
     |          |
     |          expected due to this
     |          found signature defined here
     |
     = note: expected closure signature `fn(&ServiceType) -> _`
                found closure signature `fn(&'xso_proc_as_xml_iter_lifetime std::string::String) -> _`
note: required by a bound in `std::option::Option::<T>::map`
    --> /home/jssfr/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs:1102:12
     |
1100 |     pub fn map<U, F>(self, f: F) -> Option<U>
     |            --- required by a bound in this associated function
1101 |     where
1102 |         F: FnOnce(T) -> U,
     |            ^^^^^^^^^^^^^^ required by this bound in `Option::<T>::map`
     = note: this error originates in the derive macro `AsXml` (in Nightly builds, run with -Z macro-backtrace for more info)

```

Afterwards, this:

```
error[E0308]: mismatched types
   --> muchopper/libmuchopper/src/xmpp/sjn_api.rs:207:20
    |
206 |     #[xml(extract(namespace = ECS, name = "service-type", fields(text(type_ = String))))]
    |                                                                               ------ expected due to this
207 |     pub service_type: ServiceType,
    |                       ^^^^^^^^^^^ expected `Option<&String>`, found `Option<&ServiceType>`
    |
    = note: expected enum `std::option::Option<&'xso_proc_as_xml_iter_lifetime std::string::String>`
               found enum `std::option::Option<&ServiceType>`

```

skip-changelog, because this affects a feature which already has an
"Added" line in the changelog.

Jonas Schäfer created

727e57b Implement `#[xml(flag)]` meta

Jonas Schäfer created

4eff630 Fix compatibility with uuid 1.12

Click to expand commit body
uuid 1.12 introduced the NonNilUuid type, which can, like the Uuid
type, be parsed from a string. The Uuid type now implements
PartialEq<Self> and PartialEq<NonNilUuid>. That breaks type inferrence,
because the compiler now cannot know whether we want to parse a Uuid or
a NonNilUuid.

We thus have to be explicit.

Jonas Schäfer created

6ec275d Revert "xso-proc: Replace std stuff with alloc/core stuff"

Click to expand commit body
This reverts commit 4e5f0bc9615f075f1bd2094f200cdc5e37ea1976.

Unfortunately, in std contexts, the `alloc` crate is not imported. That
means we cannot rely on it being accessible and it in fact breaks builds
of crates which are not `no_std`.

Fixes #155.

Jonas Schäfer created

33098e6 Message and message_correct::Replace now has typed Id

xmppftw created

4f8d669 CI: Ensure treeish string works for main

Click to expand commit body
skip-changelog

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>

Maxime “pep” Buquet created

bbbf522 CI: Force changelog updates

Click to expand commit body
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>

Maxime “pep” Buquet created

ec72d71 xmpp-parsers: Convert SetResult to xso

Click to expand commit body
The API has changed a little but nothing much.

Emmanuel Gil Peyrot created

3d18d83 xmpp-parsers: Convert SetQuery to xso

Emmanuel Gil Peyrot created

944c5c7 xmpp-parsers: Implement XEP-0377: Spam Reporting

Emmanuel Gil Peyrot created

bfac3e8 xmpp: Receive message corrections, unchecked

xmppftw created

b8af0d8 xmpp_parsers: `--features disable-validation`

Click to expand commit body
It was broken in multiple ways:

- xso did not honour it: unknown children and attributes would cause a
  parse error even with `--features disable-validation` set on parsers.
  For this, we introduce a new feature flag on xso, `non-pedantic`,
  which defaults unknown children and attributes to discard instead of
  fail.

  Note that individual XSOs can still choose to be always pedantic or
  always lenient by explicitly declaring the intent via the
  `on_unknown_child` and `on_unknown_attribute` metas.

- Many tests in `xmpp_parsers` were broken with `--features
  disable-validation`. They now all pass while *still* being rn with
  `disable-validation` set: In that case, they test that parsing in fact
  succeeds.

Jonas Schäfer created

2e66f84 xmpp: Remove noisy info log

Click to expand commit body
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>

Maxime “pep” Buquet created

491264f jid: serde support for JID parts

xmppftw created

58698f6 xso: only take reference in transform

Click to expand commit body
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.

Jonas Schäfer created

9901141 parsers: Rename Message::get_best_owned to get_best_cloned

xmppftw created

5bc94dc tokio_xmpp: Replace std::io calls with use std::io

xmppftw created

67442bf minidom: Replace std::io calls with use std::io

xmppftw created

c8d3c06 xso: Replace std::io calls with use std::io

xmppftw created

6a662e6 xso: Replace std stuff with alloc/core stuff

xmppftw created

4e5f0bc xso-proc: Replace std stuff with alloc/core stuff

xmppftw created

4ac792b jid: Replace std stuff with alloc/core stuff

xmppftw created

3ebc30c minidom: Replace std stuff with alloc/core stuff

xmppftw created

087534b parsers: Replace std stuff with alloc/core stuff

xmppftw created

1ce2f89 tokio_xmpp: Replace std stuff with alloc/core stuff

xmppftw created

668cc05 xmpp: Replace std stuff with alloc/core stuff

xmppftw created

1c1b960 xso: Add std feature ; default-features compiles in no-std

xmppftw created

6e3f31e parsers: Add get_best_{body,subject}_owned methods for Message

xmppftw created

5042561 parsers: Add Message::extract_valid_payload helper

xmppftw created

c1a3c85 xmpp: Implement Deref<Target=ResourcePart> for RoomNick

xmppftw created

793b76d xmpp: More nicks are typed as RoomNick

xmppftw created

48cb79b xmpp: Implement FromStr for RoomNick

xmppftw created

f834716 tokio-xmpp: Add forgotten ChangeLog entry for ktls support

Emmanuel Gil Peyrot created

b8f74e6 xmpp: Common structure for imports

xmppftw created

0ec9103 xmpp: Rewrite other messages with Agent::send_raw_message

xmppftw created

b4d3252 xmpp: Add Agent::send_raw_message

xmppftw created

e19a798 xmpp: Agent::send_message is only for normal messages

xmppftw created