forked from lavina/lavina
deleted lavina-core dependency in proto-xmpp
This commit is contained in:
parent
798b27ccb2
commit
b743252916
|
@ -1376,7 +1376,6 @@ dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"assert_matches",
|
"assert_matches",
|
||||||
"derive_more",
|
"derive_more",
|
||||||
"lavina-core",
|
|
||||||
"lazy_static",
|
"lazy_static",
|
||||||
"quick-xml",
|
"quick-xml",
|
||||||
"regex",
|
"regex",
|
||||||
|
|
|
@ -4,7 +4,6 @@ edition = "2021"
|
||||||
version.workspace = true
|
version.workspace = true
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
lavina-core.workspace = true
|
|
||||||
quick-xml.workspace = true
|
quick-xml.workspace = true
|
||||||
lazy_static.workspace = true
|
lazy_static.workspace = true
|
||||||
regex.workspace = true
|
regex.workspace = true
|
||||||
|
|
|
@ -3,7 +3,6 @@ use quick_xml::events::{BytesEnd, BytesStart, BytesText, Event};
|
||||||
use quick_xml::name::{Namespace, QName, ResolveResult};
|
use quick_xml::name::{Namespace, QName, ResolveResult};
|
||||||
use quick_xml::{NsReader, Writer};
|
use quick_xml::{NsReader, Writer};
|
||||||
use tokio::io::{AsyncBufRead, AsyncWrite};
|
use tokio::io::{AsyncBufRead, AsyncWrite};
|
||||||
use lavina_core::prelude::fail;
|
|
||||||
|
|
||||||
use super::skip_text;
|
use super::skip_text;
|
||||||
|
|
||||||
|
@ -29,10 +28,10 @@ impl ClientStreamStart {
|
||||||
if let Event::Start(e) = incoming {
|
if let Event::Start(e) = incoming {
|
||||||
let (ns, local) = reader.resolve_element(e.name());
|
let (ns, local) = reader.resolve_element(e.name());
|
||||||
if ns != ResolveResult::Bound(Namespace(XMLNS.as_bytes())) {
|
if ns != ResolveResult::Bound(Namespace(XMLNS.as_bytes())) {
|
||||||
return Err(fail("Invalid namespace for stream element"));
|
return Err(anyhow!("Invalid namespace for stream element"));
|
||||||
}
|
}
|
||||||
if local.into_inner() != b"stream" {
|
if local.into_inner() != b"stream" {
|
||||||
return Err(fail("Invalid local name for stream element"));
|
return Err(anyhow!("Invalid local name for stream element"));
|
||||||
}
|
}
|
||||||
let mut to = None;
|
let mut to = None;
|
||||||
let mut lang = None;
|
let mut lang = None;
|
||||||
|
@ -65,7 +64,7 @@ impl ClientStreamStart {
|
||||||
version: version.unwrap(),
|
version: version.unwrap(),
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
Err(fail("Incoming message does not belong XML Start Event"))
|
Err(anyhow!("Incoming message does not belong XML Start Event"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue