Update euphoxide

This commit is contained in:
Joscha 2023-01-30 19:04:24 +01:00
parent 56373135c7
commit ecedad8f0f
4 changed files with 19 additions and 7 deletions

14
Cargo.lock generated
View file

@ -90,6 +90,16 @@ version = "1.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
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]]
name = "cc"
version = "1.0.78"
@ -309,9 +319,10 @@ dependencies = [
[[package]]
name = "euphoxide"
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 = [
"async-trait",
"caseless",
"clap",
"cookie",
"futures-util",
@ -322,6 +333,7 @@ dependencies = [
"tokio",
"tokio-stream",
"tokio-tungstenite",
"unicode-normalization",
]
[[package]]

View file

@ -35,7 +35,7 @@ features = ["rustls-tls-native-roots"]
[dependencies.euphoxide]
git = "https://github.com/Garmelon/euphoxide.git"
rev = "2719ab33014f790b8af76fc028c077b90e9716cb"
rev = "f394ddc5a67f53223f977ccc414bb4c949790f6b"
features = ["bot"]
# [patch."https://github.com/Garmelon/euphoxide.git"]

View file

@ -264,7 +264,7 @@ impl Room {
}
pub fn auth(&self, password: String) -> Result<(), Error> {
let _ = self.conn_tx()?.send(Auth {
self.conn_tx()?.send_only(Auth {
r#type: AuthOption::Passcode,
passcode: Some(password),
});
@ -279,7 +279,7 @@ impl Room {
}
pub fn nick(&self, name: String) -> Result<(), Error> {
let _ = self.conn_tx()?.send(Nick { name });
self.conn_tx()?.send_only(Nick { name });
Ok(())
}
@ -299,7 +299,7 @@ impl Room {
}
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(),
id: email,
password,
@ -308,7 +308,7 @@ impl Room {
}
pub fn logout(&self) -> Result<(), Error> {
let _ = self.conn_tx()?.send(Logout);
self.conn_tx()?.send_only(Logout);
Ok(())
}
}

View file

@ -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) {
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)
}