diff --git a/crates/projection-xmpp/src/iq.rs b/crates/projection-xmpp/src/iq.rs
index 0232fbc..2373306 100644
--- a/crates/projection-xmpp/src/iq.rs
+++ b/crates/projection-xmpp/src/iq.rs
@@ -1,7 +1,6 @@
//! Handling of all client2server iq stanzas
use quick_xml::events::Event;
-use serde::de::Unexpected::Option;
use lavina_core::room::{RoomId, RoomRegistry};
use proto_xmpp::bind::{BindResponse, Jid, Name, Server};
diff --git a/crates/projection-xmpp/tests/lib.rs b/crates/projection-xmpp/tests/lib.rs
index 790ee5e..c1ea13a 100644
--- a/crates/projection-xmpp/tests/lib.rs
+++ b/crates/projection-xmpp/tests/lib.rs
@@ -449,8 +449,21 @@ async fn test_message_archive_request() -> Result<()> {
s.send(r#""#).await?;
assert_matches!(s.next_xml_event().await?, Event::Start(b) => {
- assert_eq!(element_name(&b.local_name()), "message")
+ assert_eq!(element_name(&b.local_name()), "iq")
});
+ assert_matches!(s.next_xml_event().await?, Event::Start(b) => {
+ assert_eq!(element_name(&b.local_name()), "fin")
+ });
+ assert_matches!(s.next_xml_event().await?, Event::Start(b) => {
+ assert_eq!(element_name(&b.local_name()), "set")
+ });
+ assert_matches!(s.next_xml_event().await?, Event::Start(b) => {
+ assert_eq!(element_name(&b.local_name()), "count")
+ });
+ assert_matches!(s.next_xml_event().await?, Event::Text(b) => {
+ assert_eq!(&*b, b"0")
+ });
+
s.send(r#"Logged out"#).await?;
stream.shutdown().await?;
diff --git a/crates/proto-xmpp/src/mam.rs b/crates/proto-xmpp/src/mam.rs
index 5e083c6..bd7ee21 100644
--- a/crates/proto-xmpp/src/mam.rs
+++ b/crates/proto-xmpp/src/mam.rs
@@ -1,5 +1,5 @@
use anyhow::{anyhow, Result};
-use quick_xml::events::{BytesStart, Event};
+use quick_xml::events::{BytesEnd, BytesStart, BytesText, Event};
use quick_xml::name::{Namespace, ResolveResult};
use std::io::Read;
@@ -25,10 +25,12 @@ pub struct Field {
}
// Message archive response styled as a result set.
+#[derive(PartialEq, Eq, Debug, Clone)]
pub struct Fin {
pub set: Set,
}
+#[derive(PartialEq, Eq, Debug, Clone)]
pub struct Set {
pub count: Option,
}
@@ -37,7 +39,10 @@ impl FromXml for Set {
type P = impl Parser