iq: Implement the Iq*Payload traits on every possible payload.
This commit is contained in:
parent
d5f88d2636
commit
412eafb363
11 changed files with 64 additions and 0 deletions
11
src/mam.rs
11
src/mam.rs
|
|
@ -11,6 +11,7 @@ use jid::Jid;
|
|||
|
||||
use error::Error;
|
||||
|
||||
use iq::{IqGetPayload, IqSetPayload, IqResultPayload};
|
||||
use data_forms::DataForm;
|
||||
use rsm::Set;
|
||||
use forwarding::Forwarded;
|
||||
|
|
@ -25,6 +26,10 @@ pub struct Query {
|
|||
pub set: Option<Set>,
|
||||
}
|
||||
|
||||
impl IqGetPayload for Query {}
|
||||
impl IqSetPayload for Query {}
|
||||
impl IqResultPayload for Query {}
|
||||
|
||||
generate_element_with_children!(
|
||||
Result_, "result", MAM,
|
||||
attributes: [
|
||||
|
|
@ -42,6 +47,8 @@ pub struct Fin {
|
|||
pub set: Set,
|
||||
}
|
||||
|
||||
impl IqResultPayload for Fin {}
|
||||
|
||||
generate_attribute!(DefaultPrefs, "default", {
|
||||
Always => "always",
|
||||
Never => "never",
|
||||
|
|
@ -55,6 +62,10 @@ pub struct Prefs {
|
|||
pub never: Vec<Jid>,
|
||||
}
|
||||
|
||||
impl IqGetPayload for Prefs {}
|
||||
impl IqSetPayload for Prefs {}
|
||||
impl IqResultPayload for Prefs {}
|
||||
|
||||
impl TryFrom<Element> for Query {
|
||||
type Err = Error;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue