summaryrefslogtreecommitdiffstats
path: root/src/jabber.rs
diff options
context:
space:
mode:
authorLibravatar cel 🌸 <cel@blos.sm>2023-07-11 21:28:42 +0100
committerLibravatar cel 🌸 <cel@blos.sm>2023-07-11 21:28:42 +0100
commitf43911ccbae3856b35b0d3e8ec6ac6450e295da6 (patch)
tree492b195cc06b08e546c059c16a748f369995eab1 /src/jabber.rs
parent143a0365d0822e6786cdac3530a725bbf450f38f (diff)
downloadluz-f43911ccbae3856b35b0d3e8ec6ac6450e295da6.tar.gz
luz-f43911ccbae3856b35b0d3e8ec6ac6450e295da6.tar.bz2
luz-f43911ccbae3856b35b0d3e8ec6ac6450e295da6.zip
remove serde functions
Diffstat (limited to '')
-rw-r--r--src/jabber.rs16
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));
}
}
}