diff --git a/crates/proto-xmpp/src/mam.rs b/crates/proto-xmpp/src/mam.rs index 41160d8..63fc39c 100644 --- a/crates/proto-xmpp/src/mam.rs +++ b/crates/proto-xmpp/src/mam.rs @@ -35,44 +35,10 @@ pub struct Set { pub count: Option, } -impl FromXml for Set { - type P = impl Parser>; - - fn parse() -> Self::P { - |(mut namespace, mut event): (ResolveResult<'static>, &'static Event<'static>)| -> Result { - (namespace, event) = yield; - Ok(Set { count: Some(0) }) - } - } -} - -impl FromXmlTag for Set { - const NAME: &'static str = "set"; - const NS: &'static str = "http://jabber.org/protocol/rsm"; -} - -impl FromXml for Fin { - type P = impl Parser>; - - fn parse() -> Self::P { - |(mut namespace, mut event): (ResolveResult<'static>, &'static Event<'static>)| -> Result { - (namespace, event) = yield; - Ok(Fin { - set: Set { count: Some(0) }, - }) - } - } -} - -impl FromXmlTag for Fin { - const NAME: &'static str = "fin"; - const NS: &'static str = RESULT_SET_XMLNS; -} - impl ToXml for Fin { fn serialize(&self, events: &mut Vec>) { - let mut fin_bytes = BytesStart::new(format!(r#"fin xmlns="{}" complete=True"#, Fin::NS)); - let mut set_bytes = BytesStart::new(format!(r#"set xmlns="{}""#, Set::NS)); + let mut fin_bytes = BytesStart::new(format!(r#"fin xmlns="{}" complete=True"#, MAM_XMLNS)); + let mut set_bytes = BytesStart::new(format!(r#"set xmlns="{}""#, RESULT_SET_XMLNS)); events.push(Event::Start(fin_bytes)); events.push(Event::Start(set_bytes));