diff options
author | cel 🌸 <cel@blos.sm> | 2023-07-11 21:28:42 +0100 |
---|---|---|
committer | cel 🌸 <cel@blos.sm> | 2023-07-11 21:28:42 +0100 |
commit | f43911ccbae3856b35b0d3e8ec6ac6450e295da6 (patch) | |
tree | 492b195cc06b08e546c059c16a748f369995eab1 /src/jabber.rs | |
parent | 143a0365d0822e6786cdac3530a725bbf450f38f (diff) | |
download | luz-f43911ccbae3856b35b0d3e8ec6ac6450e295da6.tar.gz luz-f43911ccbae3856b35b0d3e8ec6ac6450e295da6.tar.bz2 luz-f43911ccbae3856b35b0d3e8ec6ac6450e295da6.zip |
remove serde functions
Diffstat (limited to 'src/jabber.rs')
-rw-r--r-- | src/jabber.rs | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/jabber.rs b/src/jabber.rs index a1b2a2f..a48751c 100644 --- a/src/jabber.rs +++ b/src/jabber.rs @@ -117,11 +117,12 @@ impl<'j> Jabber<'j> { .connect(&self.server, socket) .await { - let (read, writer) = tokio::io::split(stream); + let (read, write) = tokio::io::split(stream); let reader = Reader::from_reader(BufReader::new(read)); - return Ok(JabberClientType::Encrypted( - client::encrypted::JabberClient::new(reader, writer, self), - )); + let writer = Writer::new(write); + let mut client = client::encrypted::JabberClient::new(reader, writer, self); + client.start_stream().await?; + return Ok(JabberClientType::Encrypted(client)); } } false => { @@ -129,9 +130,10 @@ impl<'j> Jabber<'j> { let (read, write) = tokio::io::split(stream); let reader = Reader::from_reader(BufReader::new(read)); let writer = Writer::new(write); - return Ok(JabberClientType::Unencrypted( - client::unencrypted::JabberClient::new(reader, writer, self), - )); + let mut client = + client::unencrypted::JabberClient::new(reader, writer, self); + client.start_stream().await?; + return Ok(JabberClientType::Unencrypted(client)); } } } |