diff options
Diffstat (limited to 'stanza/src/client/iq.rs')
-rw-r--r-- | stanza/src/client/iq.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/stanza/src/client/iq.rs b/stanza/src/client/iq.rs index 6ee80ea..2e87636 100644 --- a/stanza/src/client/iq.rs +++ b/stanza/src/client/iq.rs @@ -9,6 +9,7 @@ use peanuts::{ use crate::{ bind::{self, Bind}, client::error::Error, + roster, xep_0199::{self, Ping}, }; @@ -31,6 +32,7 @@ pub struct Iq { pub enum Query { Bind(Bind), Ping(Ping), + Roster(roster::Query), Unsupported, } @@ -39,6 +41,9 @@ impl FromElement for Query { match element.identify() { (Some(bind::XMLNS), "bind") => Ok(Query::Bind(Bind::from_element(element)?)), (Some(xep_0199::XMLNS), "ping") => Ok(Query::Ping(Ping::from_element(element)?)), + (Some(roster::XMLNS), "query") => { + Ok(Query::Roster(roster::Query::from_element(element)?)) + } _ => Ok(Query::Unsupported), } } @@ -49,6 +54,7 @@ impl IntoElement for Query { match self { Query::Bind(bind) => bind.builder(), Query::Ping(ping) => ping.builder(), + Query::Roster(query) => query.builder(), // TODO: consider what to do if attempt to serialize unsupported Query::Unsupported => todo!(), } |