From 143a0365d0822e6786cdac3530a725bbf450f38f Mon Sep 17 00:00:00 2001 From: cel 🌸 Date: Tue, 4 Jul 2023 21:27:15 +0100 Subject: horrible --- src/client/unencrypted.rs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'src/client/unencrypted.rs') diff --git a/src/client/unencrypted.rs b/src/client/unencrypted.rs index 74b800c..d4225d3 100644 --- a/src/client/unencrypted.rs +++ b/src/client/unencrypted.rs @@ -115,14 +115,12 @@ impl<'j> JabberClient<'j> { .connect(&self.jabber.server, stream) .await { - let (read, write) = tokio::io::split(tlsstream); + let (read, writer) = tokio::io::split(tlsstream); let reader = Reader::from_reader(BufReader::new(read)); - let writer = Writer::new(write); - return Ok(super::encrypted::JabberClient::new( - reader, - writer, - self.jabber, - )); + let mut client = + super::encrypted::JabberClient::new(reader, writer, self.jabber); + client.start_stream().await?; + return Ok(client); } } QName(_) => return Err(JabberError::TlsNegotiation), -- cgit