add XMPPStream.send_stanza() convenience method
This commit is contained in:
parent
06b97ea228
commit
71e2b1c84f
4 changed files with 14 additions and 8 deletions
|
|
@ -76,7 +76,7 @@ impl<S: AsyncWrite> ClientAuth<S> {
|
|||
.append(content.to_base64(base64::STANDARD))
|
||||
.build();
|
||||
|
||||
let send = stream.send(Packet::Stanza(nonza));
|
||||
let send = stream.send_stanza(nonza);
|
||||
|
||||
self.state = ClientAuthState::WaitSend(send);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,10 +32,8 @@ impl<S: AsyncWrite> ClientBind<S> {
|
|||
ClientBind::Unsupported(stream),
|
||||
Some(_) => {
|
||||
let resource = stream.jid.resource.clone();
|
||||
let iq = Element::from(
|
||||
Bind::new(resource)
|
||||
);
|
||||
let send = stream.send(Packet::Stanza(iq));
|
||||
let iq = Bind::new(resource);
|
||||
let send = stream.send_stanza(iq);
|
||||
ClientBind::WaitSend(send)
|
||||
},
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue