summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/client/unencrypted.rs1
-rw-r--r--src/stanza/stream.rs11
2 files changed, 7 insertions, 5 deletions
diff --git a/src/client/unencrypted.rs b/src/client/unencrypted.rs
index 3f3a133..dcd10c6 100644
--- a/src/client/unencrypted.rs
+++ b/src/client/unencrypted.rs
@@ -52,7 +52,6 @@ impl<'j> JabberClient<'j> {
pub async fn get_features(&mut self) -> Result<Option<Vec<StreamFeature>>> {
if let Some(features) = Element::read(&mut self.reader).await? {
- println!("{:?}", features);
Ok(Some(features.try_into()?))
} else {
Ok(None)
diff --git a/src/stanza/stream.rs b/src/stanza/stream.rs
index 59d0b90..32f449d 100644
--- a/src/stanza/stream.rs
+++ b/src/stanza/stream.rs
@@ -43,7 +43,7 @@ pub struct Stream {
to: Option<JID>,
version: Option<String>,
lang: Option<String>,
- _ns: XMLNS,
+ ns: XMLNS,
}
impl Stream {
@@ -54,7 +54,7 @@ impl Stream {
to: Some(to.clone()),
version: Some(VERSION.to_owned()),
lang,
- _ns: XMLNS::Client,
+ ns: XMLNS::Client,
}
}
@@ -75,7 +75,10 @@ impl Stream {
if let Some(lang) = &self.lang {
start.push_attribute(("xml:lang", lang.as_str()));
}
- start.push_attribute(("xmlns", XMLNS::Client.into()));
+ match &self.ns {
+ XMLNS::Client => start.push_attribute(("xmlns", XMLNS::Client.into())),
+ XMLNS::Server => start.push_attribute(("xmlns", XMLNS::Server.into())),
+ }
start.push_attribute(("xmlns:stream", XMLNS_STREAM));
start
}
@@ -129,7 +132,7 @@ impl<'e> TryFrom<Element<'e>> for Stream {
to,
version,
lang,
- _ns: ns,
+ ns,
})
} else {
Err(JabberError::ParseError)