summaryrefslogtreecommitdiffstats
path: root/src/stanza/stream.rs
diff options
context:
space:
mode:
authorLibravatar cel 🌸 <cel@blos.sm>2023-07-12 13:03:04 +0100
committerLibravatar cel 🌸 <cel@blos.sm>2023-07-12 13:03:04 +0100
commit84d861c2b2614477ce4a85ca6dbac70cdccf2944 (patch)
treef0f91f8c971c225d2e55d7b911f3e2d2450d851a /src/stanza/stream.rs
parent39b7d3cb63faafe446b9a0695d6ef06ae50f7afb (diff)
downloadluz-84d861c2b2614477ce4a85ca6dbac70cdccf2944.tar.gz
luz-84d861c2b2614477ce4a85ca6dbac70cdccf2944.tar.bz2
luz-84d861c2b2614477ce4a85ca6dbac70cdccf2944.zip
use Stream 'ns' value
Diffstat (limited to 'src/stanza/stream.rs')
-rw-r--r--src/stanza/stream.rs11
1 files changed, 7 insertions, 4 deletions
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)