use the minidom ElementBuilder::text method

This commit is contained in:
lumi 2017-02-21 00:07:10 +01:00
commit d31caae5a0
2 changed files with 9 additions and 9 deletions

View file

@ -141,11 +141,11 @@ impl Client {
auth.extend(self.jid.node.as_ref().expect("JID has no node").bytes());
auth.push(0);
auth.extend(password.bytes());
let mut elem = Element::builder("auth")
.ns(ns::SASL)
.attr("mechanism", "PLAIN")
.build();
elem.append_text_node(base64::encode(&auth));
let elem = Element::builder("auth")
.text(base64::encode(&auth))
.ns(ns::SASL)
.attr("mechanism", "PLAIN")
.build();
self.transport.write_element(&elem)?;
did_sasl = true;
}