Update euphoxide
This commit is contained in:
parent
56373135c7
commit
ecedad8f0f
4 changed files with 19 additions and 7 deletions
14
Cargo.lock
generated
14
Cargo.lock
generated
|
|
@ -90,6 +90,16 @@ version = "1.3.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "dfb24e866b15a1af2a1b663f10c6b6b8f397a84aadb828f12e5b289ec23a3a3c"
|
checksum = "dfb24e866b15a1af2a1b663f10c6b6b8f397a84aadb828f12e5b289ec23a3a3c"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "caseless"
|
||||||
|
version = "0.2.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "808dab3318747be122cb31d36de18d4d1c81277a76f8332a02b81a3d73463d7f"
|
||||||
|
dependencies = [
|
||||||
|
"regex",
|
||||||
|
"unicode-normalization",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cc"
|
name = "cc"
|
||||||
version = "1.0.78"
|
version = "1.0.78"
|
||||||
|
|
@ -309,9 +319,10 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "euphoxide"
|
name = "euphoxide"
|
||||||
version = "0.2.0"
|
version = "0.2.0"
|
||||||
source = "git+https://github.com/Garmelon/euphoxide.git?rev=2719ab33014f790b8af76fc028c077b90e9716cb#2719ab33014f790b8af76fc028c077b90e9716cb"
|
source = "git+https://github.com/Garmelon/euphoxide.git?rev=f394ddc5a67f53223f977ccc414bb4c949790f6b#f394ddc5a67f53223f977ccc414bb4c949790f6b"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"async-trait",
|
"async-trait",
|
||||||
|
"caseless",
|
||||||
"clap",
|
"clap",
|
||||||
"cookie",
|
"cookie",
|
||||||
"futures-util",
|
"futures-util",
|
||||||
|
|
@ -322,6 +333,7 @@ dependencies = [
|
||||||
"tokio",
|
"tokio",
|
||||||
"tokio-stream",
|
"tokio-stream",
|
||||||
"tokio-tungstenite",
|
"tokio-tungstenite",
|
||||||
|
"unicode-normalization",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ features = ["rustls-tls-native-roots"]
|
||||||
|
|
||||||
[dependencies.euphoxide]
|
[dependencies.euphoxide]
|
||||||
git = "https://github.com/Garmelon/euphoxide.git"
|
git = "https://github.com/Garmelon/euphoxide.git"
|
||||||
rev = "2719ab33014f790b8af76fc028c077b90e9716cb"
|
rev = "f394ddc5a67f53223f977ccc414bb4c949790f6b"
|
||||||
features = ["bot"]
|
features = ["bot"]
|
||||||
|
|
||||||
# [patch."https://github.com/Garmelon/euphoxide.git"]
|
# [patch."https://github.com/Garmelon/euphoxide.git"]
|
||||||
|
|
|
||||||
|
|
@ -264,7 +264,7 @@ impl Room {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn auth(&self, password: String) -> Result<(), Error> {
|
pub fn auth(&self, password: String) -> Result<(), Error> {
|
||||||
let _ = self.conn_tx()?.send(Auth {
|
self.conn_tx()?.send_only(Auth {
|
||||||
r#type: AuthOption::Passcode,
|
r#type: AuthOption::Passcode,
|
||||||
passcode: Some(password),
|
passcode: Some(password),
|
||||||
});
|
});
|
||||||
|
|
@ -279,7 +279,7 @@ impl Room {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn nick(&self, name: String) -> Result<(), Error> {
|
pub fn nick(&self, name: String) -> Result<(), Error> {
|
||||||
let _ = self.conn_tx()?.send(Nick { name });
|
self.conn_tx()?.send_only(Nick { name });
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -299,7 +299,7 @@ impl Room {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn login(&self, email: String, password: String) -> Result<(), Error> {
|
pub fn login(&self, email: String, password: String) -> Result<(), Error> {
|
||||||
let _ = self.conn_tx()?.send(Login {
|
self.conn_tx()?.send_only(Login {
|
||||||
namespace: "email".to_string(),
|
namespace: "email".to_string(),
|
||||||
id: email,
|
id: email,
|
||||||
password,
|
password,
|
||||||
|
|
@ -308,7 +308,7 @@ impl Room {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn logout(&self) -> Result<(), Error> {
|
pub fn logout(&self) -> Result<(), Error> {
|
||||||
let _ = self.conn_tx()?.send(Logout);
|
self.conn_tx()?.send_only(Logout);
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ fn hsl_to_rgb(h: f32, s: f32, l: f32) -> (u8, u8, u8) {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn nick_color(nick: &str) -> (u8, u8, u8) {
|
pub fn nick_color(nick: &str) -> (u8, u8, u8) {
|
||||||
let hue = euphoxide::nick_hue(&EMOJI, nick) as f32;
|
let hue = euphoxide::nick::hue(&EMOJI, nick) as f32;
|
||||||
hsl_to_rgb(hue, 1.0, 0.72)
|
hsl_to_rgb(hue, 1.0, 0.72)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue