diff --git a/src/base_client.rs b/src/base_client.rs index 6333992f..b910d53d 100644 --- a/src/base_client.rs +++ b/src/base_client.rs @@ -73,13 +73,7 @@ pub struct CurrentRoom { impl CurrentRoom { // TODO when UserId is isomorphic to &str clean this up. pub(crate) fn comes_after(&self, user: &Uid, event: &PresenceEvent) -> bool { - let u = user.to_string(); - let u = u.split(':').next(); - - let s = event.sender.to_string(); - let s = s.split(':').next(); - - if u == s { + if user == &event.sender { if self.last_active.is_none() { true } else { @@ -217,7 +211,6 @@ impl Client { } pub(crate) fn get_room(&mut self, room_id: &str) -> Option<&mut Arc>> { - #[allow(clippy::or_fun_call)] self.joined_rooms.get_mut(room_id) } diff --git a/src/models/room.rs b/src/models/room.rs index 428d7342..5e1ba558 100644 --- a/src/models/room.rs +++ b/src/models/room.rs @@ -319,7 +319,7 @@ mod test { let session = Session { access_token: "1234".to_owned(), - user_id: UserId::try_from("@example:example.com").unwrap(), + user_id: UserId::try_from("@example:localhost").unwrap(), device_id: "DEVICEID".to_owned(), }; diff --git a/src/models/room_member.rs b/src/models/room_member.rs index 9c806c18..91c2b71d 100644 --- a/src/models/room_member.rs +++ b/src/models/room_member.rs @@ -152,7 +152,7 @@ mod test { let session = Session { access_token: "1234".to_owned(), - user_id: UserId::try_from("@example:example.com").unwrap(), + user_id: UserId::try_from("@example:localhost").unwrap(), device_id: "DEVICEID".to_owned(), }; diff --git a/tests/async_client_tests.rs b/tests/async_client_tests.rs index 415dec98..5403eea7 100644 --- a/tests/async_client_tests.rs +++ b/tests/async_client_tests.rs @@ -35,7 +35,7 @@ async fn sync() { let session = Session { access_token: "1234".to_owned(), - user_id: UserId::try_from("@example:example.com").unwrap(), + user_id: UserId::try_from("@example:localhost").unwrap(), device_id: "DEVICEID".to_owned(), }; @@ -64,7 +64,7 @@ async fn room_names() { let session = Session { access_token: "1234".to_owned(), - user_id: UserId::try_from("@example:example.com").unwrap(), + user_id: UserId::try_from("@example:localhost").unwrap(), device_id: "DEVICEID".to_owned(), }; @@ -95,7 +95,7 @@ async fn current_room() { let session = Session { access_token: "1234".to_owned(), - user_id: UserId::try_from("@example:example.com").unwrap(), + user_id: UserId::try_from("@example:localhost").unwrap(), device_id: "DEVICEID".to_owned(), };