mirror of
https://gitlab.com/xmpp-rs/xmpp-rs.git
synced 2024-07-12 22:21:53 +00:00
jingle_s5b: Make jid a Jid and not a String.
This commit is contained in:
parent
f6b222f49a
commit
4338d9d638
1 changed files with 4 additions and 3 deletions
|
@ -8,6 +8,7 @@ use std::convert::TryFrom;
|
|||
use std::str::FromStr;
|
||||
|
||||
use minidom::{Element, IntoAttributeValue};
|
||||
use jid::Jid;
|
||||
|
||||
use error::Error;
|
||||
|
||||
|
@ -33,7 +34,7 @@ generate_id!(StreamId);
|
|||
pub struct Candidate {
|
||||
pub cid: CandidateId,
|
||||
pub host: String,
|
||||
pub jid: String,
|
||||
pub jid: Jid,
|
||||
pub port: Option<u16>,
|
||||
pub priority: u32,
|
||||
pub type_: Type,
|
||||
|
@ -45,7 +46,7 @@ impl Into<Element> for Candidate {
|
|||
.ns(ns::JINGLE_S5B)
|
||||
.attr("cid", self.cid)
|
||||
.attr("host", self.host)
|
||||
.attr("jid", self.jid)
|
||||
.attr("jid", String::from(self.jid))
|
||||
.attr("port", self.port)
|
||||
.attr("priority", self.priority)
|
||||
.attr("type", self.type_)
|
||||
|
@ -217,7 +218,7 @@ mod tests {
|
|||
payload: TransportPayload::Candidates(vec!(Candidate {
|
||||
cid: CandidateId(String::from("coucou")),
|
||||
host: String::from("coucou"),
|
||||
jid: String::from("coucou@coucou"),
|
||||
jid: Jid::from_str("coucou@coucou").unwrap(),
|
||||
port: None,
|
||||
priority: 0u32,
|
||||
type_: Type::Direct,
|
||||
|
|
Loading…
Reference in a new issue