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.
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?
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.
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.
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.
This XEP is used to synchronize where each client has stopped reading a
conversation, so that we can e.g. stop displaying a notification when
the user has read this particular message on a different device.
This is useful if, for example during stream negotiation, you want to
parse SASL elements and nothing else. It is also useful if you want to
write down an enum of all XMPP-related stream-level elements you accept
and don't want to loose your fingers typing all the SASL options.
You may note that I removed the `exhaustive` flag on the
DefinedCondition enum. This is because other elements in the same
namespace may occur as siblings of that enum, hence using `exhaustive`
may cause incorrect parse errors.
(If parsing attempts to process the `<text/>` child as DefinedCondition
first, DefinedCondition will return a fatal parser error if it is set as
exhaustive because no condition matches `text`.)
This introduces a breaking change by moving from a bool to an
Option<NoCertManagement>, which will be reverted eventually once we add
support for #[xml(flag)] types of children.