From 65fa1b8afda0c67f693b79f108fe93297daeec46 Mon Sep 17 00:00:00 2001 From: Joscha Date: Sun, 26 Feb 2023 20:51:28 +0100 Subject: [PATCH] Update euphoxide This fixes authentication for rooms requiring passwords --- Cargo.lock | 20 ++++++++++---------- Cargo.toml | 2 +- src/ui/euph/room.rs | 12 +++++++----- src/ui/rooms.rs | 2 +- 4 files changed, 19 insertions(+), 17 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 42a6604..45fdbf9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -114,9 +114,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.1.4" +version = "4.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f13b9c79b5d1dd500d20ef541215a6423c75829ef43117e1b4d17fd8af0b5d76" +checksum = "ec0b0588d44d4d63a87dbd75c136c166bbfd9a86a31cb89e09906521c7d3f5e3" dependencies = [ "bitflags", "clap_derive", @@ -319,8 +319,8 @@ dependencies = [ [[package]] name = "euphoxide" -version = "0.3.0" -source = "git+https://github.com/Garmelon/euphoxide.git?rev=069e4e02c77e5bc649cd770af8183d8be8cd52f5#069e4e02c77e5bc649cd770af8183d8be8cd52f5" +version = "0.3.1" +source = "git+https://github.com/Garmelon/euphoxide.git?tag=v0.3.1#1844cddcc01696ef4d04c957de8b84d6247d9332" dependencies = [ "async-trait", "caseless", @@ -1146,9 +1146,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.17" +version = "0.3.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a561bf4617eebd33bca6434b988f39ed798e527f51a1e797d0ee4f61c0a38376" +checksum = "cd0cbfecb4d19b5ea75bb31ad904eb5b9fa13f21079c3b92017ebdf4999a5890" dependencies = [ "itoa", "serde", @@ -1164,9 +1164,9 @@ checksum = "2e153e1f1acaef8acc537e68b44906d2db6436e2b35ac2c6b42640fff91f00fd" [[package]] name = "time-macros" -version = "0.2.6" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d967f99f534ca7e495c575c62638eebc2898a8c84c119b89e250477bc4ba16b2" +checksum = "fd80a657e71da814b8e5d60d3374fc6d35045062245d80224748ae522dd76f36" dependencies = [ "time-core", ] @@ -1230,9 +1230,9 @@ dependencies = [ [[package]] name = "tokio-stream" -version = "0.1.11" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d660770404473ccd7bc9f8b28494a811bc18542b915c0855c51e8f419d5223ce" +checksum = "8fb52b74f05dbf495a8fba459fdc331812b96aa086d9eb78101fa0d4569c3313" dependencies = [ "futures-core", "pin-project-lite", diff --git a/Cargo.toml b/Cargo.toml index bc38f83..f8bc8e5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -35,7 +35,7 @@ features = ["rustls-tls-native-roots"] [dependencies.euphoxide] git = "https://github.com/Garmelon/euphoxide.git" -rev = "069e4e02c77e5bc649cd770af8183d8be8cd52f5" +tag = "v0.3.1" features = ["bot"] # [patch."https://github.com/Garmelon/euphoxide.git"] diff --git a/src/ui/euph/room.rs b/src/ui/euph/room.rs index 0d48d57..a1aa873 100644 --- a/src/ui/euph/room.rs +++ b/src/ui/euph/room.rs @@ -95,12 +95,14 @@ impl EuphRoom { self.vault().room() } - pub fn connect(&mut self, next_instance_id: &mut u32) { + pub fn connect(&mut self, next_instance_id: &mut usize) { if self.room.is_none() { + let room = self.vault().room(); let instance_config = self .server_config .clone() - .room(*next_instance_id, self.vault().room().to_string()) + .room(self.vault().room().to_string()) + .name(format!("{room}-{}", next_instance_id)) .username(self.config.username.clone()) .force_username(self.config.force_username) .password(self.config.password.clone()); @@ -680,9 +682,9 @@ impl EuphRoom { Some(room) => room, }; - if event.config().id != room.instance().config().id { - // If we allowed ids other than the current one, old instances that - // haven't yet shut down properly could mess up our state. + if event.config().name != room.instance().config().name { + // If we allowed names other than the current one, old instances + // that haven't yet shut down properly could mess up our state. return false; } diff --git a/src/ui/rooms.rs b/src/ui/rooms.rs index 2718eb0..60cb9ee 100644 --- a/src/ui/rooms.rs +++ b/src/ui/rooms.rs @@ -61,7 +61,7 @@ pub struct Rooms { order: Order, euph_server_config: ServerConfig, - euph_next_instance_id: u32, + euph_next_instance_id: usize, euph_rooms: HashMap, }