From 4460a59bc8a56dab9f75011b442147076c284b48 Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Tue, 5 Sep 2023 17:08:30 +0200 Subject: [PATCH] xmpp-parsers: XEP-0257: Correctly serialise no-cert-management This element was previously always put in the generated element. --- parsers/src/util/macros.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/parsers/src/util/macros.rs b/parsers/src/util/macros.rs index 2fc95cff..ed094101 100644 --- a/parsers/src/util/macros.rs +++ b/parsers/src/util/macros.rs @@ -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(