diff --git a/src/bind.rs b/src/bind.rs index 17e1e12..22beccd 100644 --- a/src/bind.rs +++ b/src/bind.rs @@ -7,7 +7,7 @@ use crate::util::error::Error; use crate::iq::{IqResultPayload, IqSetPayload}; use crate::ns; -use jid::FullJid; +use jid::{FullJid, Jid}; use minidom::Element; use std::str::FromStr; use std::convert::TryFrom; @@ -85,6 +85,18 @@ pub struct BindResponse { impl IqResultPayload for BindResponse {} +impl From for FullJid { + fn from(bind: BindResponse) -> FullJid { + bind.jid + } +} + +impl From for Jid { + fn from(bind: BindResponse) -> Jid { + Jid::Full(bind.jid) + } +} + impl TryFrom for BindResponse { type Error = Error;