mirror of
https://gitlab.com/xmpp-rs/xmpp-rs.git
synced 2024-07-12 22:21:53 +00:00
use the minidom ElementBuilder::text method
This commit is contained in:
parent
6e7ec9ddb4
commit
d31caae5a0
2 changed files with 9 additions and 9 deletions
|
@ -141,11 +141,11 @@ impl Client {
|
||||||
auth.extend(self.jid.node.as_ref().expect("JID has no node").bytes());
|
auth.extend(self.jid.node.as_ref().expect("JID has no node").bytes());
|
||||||
auth.push(0);
|
auth.push(0);
|
||||||
auth.extend(password.bytes());
|
auth.extend(password.bytes());
|
||||||
let mut elem = Element::builder("auth")
|
let elem = Element::builder("auth")
|
||||||
.ns(ns::SASL)
|
.text(base64::encode(&auth))
|
||||||
.attr("mechanism", "PLAIN")
|
.ns(ns::SASL)
|
||||||
.build();
|
.attr("mechanism", "PLAIN")
|
||||||
elem.append_text_node(base64::encode(&auth));
|
.build();
|
||||||
self.transport.write_element(&elem)?;
|
self.transport.write_element(&elem)?;
|
||||||
did_sasl = true;
|
did_sasl = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -75,10 +75,10 @@ impl PresencePlugin {
|
||||||
.ns(ns::CLIENT)
|
.ns(ns::CLIENT)
|
||||||
.build();
|
.build();
|
||||||
if let Some(stat) = status {
|
if let Some(stat) = status {
|
||||||
let mut elem = Element::builder("status")
|
let elem = Element::builder("status")
|
||||||
.ns(ns::CLIENT)
|
.ns(ns::CLIENT)
|
||||||
.build();
|
.text(stat)
|
||||||
elem.append_text_node(stat);
|
.build();
|
||||||
stanza.append_child(elem);
|
stanza.append_child(elem);
|
||||||
}
|
}
|
||||||
let mut elem = Element::builder("show")
|
let mut elem = Element::builder("show")
|
||||||
|
|
Loading…
Reference in a new issue