From c85bde3d2eceef902d2c07a012de364dedd49245 Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Sun, 28 Jul 2024 18:11:57 +0200 Subject: [PATCH] xmpp-parsers: Convert MetadataResponse to xso --- parsers/src/mam.rs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/parsers/src/mam.rs b/parsers/src/mam.rs index 15f3b0a5..dd6b12c9 100644 --- a/parsers/src/mam.rs +++ b/parsers/src/mam.rs @@ -198,16 +198,18 @@ pub struct MetadataQuery; impl IqGetPayload for MetadataQuery {} -generate_element!( /// Response from the archive, containing the start and end metadata if it isn’t empty. -MetadataResponse, "metadata", MAM, -children: [ +#[derive(FromXml, AsXml, Debug, Clone, PartialEq)] +#[xml(namespace = ns::MAM, name = "metadata")] +pub struct MetadataResponse { /// Metadata about the first message in the archive. - start: Option = ("start", MAM) => Start, + #[xml(child(default))] + start: Option, /// Metadata about the last message in the archive. - end: Option = ("end", MAM) => End, -]); + #[xml(child(default))] + end: Option, +} impl IqResultPayload for MetadataResponse {}