xmpp-parsers: XEP-0257: Correctly serialise no-cert-management

This element was previously always put in the generated element.
This commit is contained in:
Emmanuel Gil Peyrot 2023-09-05 17:08:30 +02:00
parent 5a1ef42369
commit 4460a59bc8

View file

@ -589,9 +589,11 @@ macro_rules! generate_serialiser {
$builder.append_all($parent.$elem.into_iter())
};
($builder:ident, $parent:ident, $elem:ident, Present, $constructor:ident, ($name:tt, $ns:ident)) => {
$builder.append(::minidom::Node::Element(
crate::Element::builder($name, crate::ns::$ns).build(),
))
$builder.append_all(
$parent
.$elem
.then(|| crate::Element::builder($name, crate::ns::$ns)),
)
};
($builder:ident, $parent:ident, $elem:ident, $_:ident, $constructor:ident, ($name:tt, $ns:ident)) => {
$builder.append(::minidom::Node::Element(crate::Element::from(