aboutsummaryrefslogtreecommitdiffstats
path: root/jabber
diff options
context:
space:
mode:
Diffstat (limited to 'jabber')
-rw-r--r--jabber/src/client.rs5
-rw-r--r--jabber/src/jabber_stream/bound_stream.rs1
2 files changed, 6 insertions, 0 deletions
diff --git a/jabber/src/client.rs b/jabber/src/client.rs
index f5d5dc7..2e59d98 100644
--- a/jabber/src/client.rs
+++ b/jabber/src/client.rs
@@ -26,6 +26,7 @@ use crate::{
pub struct JabberClient {
connection: ConnectionState,
jid: JID,
+ // TODO: have reconnection be handled by another part, so creds don't need to be stored in object
password: Arc<SASLConfig>,
server: String,
}
@@ -49,6 +50,10 @@ impl JabberClient {
})
}
+ pub fn jid(&self) -> JID {
+ self.jid.clone()
+ }
+
pub async fn connect(&mut self) -> Result<()> {
match &self.connection {
ConnectionState::Disconnected => {
diff --git a/jabber/src/jabber_stream/bound_stream.rs b/jabber/src/jabber_stream/bound_stream.rs
index c0d67b0..627158a 100644
--- a/jabber/src/jabber_stream/bound_stream.rs
+++ b/jabber/src/jabber_stream/bound_stream.rs
@@ -63,6 +63,7 @@ where
if let Some(_write_handle) = this.write_handle {
panic!("start_send called without poll_ready")
} else {
+ // TODO: switch to buffer of one rather than thread spawning and joining
*this.write_handle = Some(tokio::spawn(write(this.writer.clone(), item)));
Ok(())
}