diff --git a/src/iq.rs b/src/iq.rs
index 43624750..d2d4a689 100644
--- a/src/iq.rs
+++ b/src/iq.rs
@@ -21,6 +21,7 @@ use disco::Disco;
use ibb::IBB;
use jingle::Jingle;
use ping::Ping;
+use mam::{Query as MamQuery, Fin as MamFin, Prefs as MamPrefs};
/// Lists every known payload of a ``.
#[derive(Debug, Clone)]
@@ -29,6 +30,9 @@ pub enum IqPayload {
IBB(IBB),
Jingle(Jingle),
Ping(Ping),
+ MamQuery(MamQuery),
+ MamFin(MamFin),
+ MamPrefs(MamPrefs),
Unknown(Element),
}
@@ -52,6 +56,11 @@ impl<'a> TryFrom<&'a Element> for IqPayload {
// XEP-0199
("ping", ns::PING) => IqPayload::Ping(Ping::try_from(elem)?),
+ // XEP-0313
+ ("query", ns::MAM) => IqPayload::MamQuery(MamQuery::try_from(elem)?),
+ ("fin", ns::MAM) => IqPayload::MamFin(MamFin::try_from(elem)?),
+ ("prefs", ns::MAM) => IqPayload::MamPrefs(MamPrefs::try_from(elem)?),
+
_ => IqPayload::Unknown(elem.clone()),
})
}
@@ -166,6 +175,9 @@ impl<'a> Into for &'a IqPayload {
IqPayload::IBB(ref ibb) => ibb.into(),
IqPayload::Jingle(ref jingle) => jingle.into(),
IqPayload::Ping(ref ping) => ping.into(),
+ IqPayload::MamQuery(ref query) => query.into(),
+ IqPayload::MamFin(ref fin) => fin.into(),
+ IqPayload::MamPrefs(ref prefs) => prefs.into(),
IqPayload::Unknown(ref elem) => elem.clone(),
}
diff --git a/src/message.rs b/src/message.rs
index 96153cfa..dae600e8 100644
--- a/src/message.rs
+++ b/src/message.rs
@@ -24,6 +24,7 @@ use attention::Attention;
use message_correct::Replace;
use eme::ExplicitMessageEncryption;
use stanza_id::StanzaId;
+use mam::Result_ as MamResult;
/// Lists every known payload of a ``.
#[derive(Debug, Clone)]
@@ -36,6 +37,7 @@ pub enum MessagePayload {
MessageCorrect(Replace),
ExplicitMessageEncryption(ExplicitMessageEncryption),
StanzaId(StanzaId),
+ MamResult(MamResult),
Unknown(Element),
}
@@ -67,6 +69,9 @@ impl<'a> TryFrom<&'a Element> for MessagePayload {
// XEP-0308
("replace", ns::MESSAGE_CORRECT) => MessagePayload::MessageCorrect(Replace::try_from(elem)?),
+ // XEP-0313
+ ("result", ns::MAM) => MessagePayload::MamResult(MamResult::try_from(elem)?),
+
// XEP-0359
("stanza-id", ns::SID) => MessagePayload::StanzaId(StanzaId::try_from(elem)?),
@@ -89,6 +94,7 @@ impl<'a> Into for &'a MessagePayload {
MessagePayload::MessageCorrect(ref replace) => replace.into(),
MessagePayload::ExplicitMessageEncryption(ref eme) => eme.into(),
MessagePayload::StanzaId(ref stanza_id) => stanza_id.into(),
+ MessagePayload::MamResult(ref result) => result.into(),
MessagePayload::Unknown(ref elem) => elem.clone(),
}