presence: Wire up legacy caps.
This commit is contained in:
parent
2c77c4f701
commit
357568813d
1 changed files with 6 additions and 0 deletions
|
@ -17,6 +17,7 @@ use error::Error;
|
||||||
use ns;
|
use ns;
|
||||||
|
|
||||||
use stanza_error::StanzaError;
|
use stanza_error::StanzaError;
|
||||||
|
use caps::Caps;
|
||||||
use delay::Delay;
|
use delay::Delay;
|
||||||
use idle::Idle;
|
use idle::Idle;
|
||||||
use ecaps2::ECaps2;
|
use ecaps2::ECaps2;
|
||||||
|
@ -66,6 +67,7 @@ pub type Priority = i8;
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
pub enum PresencePayload {
|
pub enum PresencePayload {
|
||||||
StanzaError(StanzaError),
|
StanzaError(StanzaError),
|
||||||
|
Caps(Caps),
|
||||||
Delay(Delay),
|
Delay(Delay),
|
||||||
Idle(Idle),
|
Idle(Idle),
|
||||||
ECaps2(ECaps2),
|
ECaps2(ECaps2),
|
||||||
|
@ -80,6 +82,9 @@ impl TryFrom<Element> for PresencePayload {
|
||||||
Ok(match (elem.name().as_ref(), elem.ns().unwrap().as_ref()) {
|
Ok(match (elem.name().as_ref(), elem.ns().unwrap().as_ref()) {
|
||||||
("error", ns::JABBER_CLIENT) => PresencePayload::StanzaError(StanzaError::try_from(elem)?),
|
("error", ns::JABBER_CLIENT) => PresencePayload::StanzaError(StanzaError::try_from(elem)?),
|
||||||
|
|
||||||
|
// XEP-0115
|
||||||
|
("c", ns::CAPS) => PresencePayload::Caps(Caps::try_from(elem)?),
|
||||||
|
|
||||||
// XEP-0203
|
// XEP-0203
|
||||||
("delay", ns::DELAY) => PresencePayload::Delay(Delay::try_from(elem)?),
|
("delay", ns::DELAY) => PresencePayload::Delay(Delay::try_from(elem)?),
|
||||||
|
|
||||||
|
@ -98,6 +103,7 @@ impl Into<Element> for PresencePayload {
|
||||||
fn into(self) -> Element {
|
fn into(self) -> Element {
|
||||||
match self {
|
match self {
|
||||||
PresencePayload::StanzaError(stanza_error) => stanza_error.into(),
|
PresencePayload::StanzaError(stanza_error) => stanza_error.into(),
|
||||||
|
PresencePayload::Caps(caps) => caps.into(),
|
||||||
PresencePayload::Delay(delay) => delay.into(),
|
PresencePayload::Delay(delay) => delay.into(),
|
||||||
PresencePayload::Idle(idle) => idle.into(),
|
PresencePayload::Idle(idle) => idle.into(),
|
||||||
PresencePayload::ECaps2(ecaps2) => ecaps2.into(),
|
PresencePayload::ECaps2(ecaps2) => ecaps2.into(),
|
||||||
|
|
Loading…
Reference in a new issue