add XMPPStream.send_stanza() convenience method

This commit is contained in:
Astro 2018-08-02 00:19:06 +02:00
commit 71e2b1c84f
4 changed files with 14 additions and 8 deletions

View file

@ -34,8 +34,8 @@ impl<S: AsyncWrite> ComponentAuth<S> {
}
fn send(&mut self, stream: XMPPStream<S>, handshake: Handshake) {
let nonza = Element::from(handshake);
let send = stream.send(Packet::Stanza(nonza));
let nonza = handshake;
let send = stream.send_stanza(nonza);
self.state = ComponentAuthState::WaitSend(send);
}