From 1283dc64775b7e4c473cdbfed5a562fbd0d046f8 Mon Sep 17 00:00:00 2001 From: Charles Hall Date: Mon, 15 Jul 2024 20:44:16 -0700 Subject: [PATCH] fix service/rooms/state_accessor events --- src/service/rooms/state_accessor.rs | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/src/service/rooms/state_accessor.rs b/src/service/rooms/state_accessor.rs index 96839c9f..99502700 100644 --- a/src/service/rooms/state_accessor.rs +++ b/src/service/rooms/state_accessor.rs @@ -188,8 +188,8 @@ impl Service { current_server_members .any(|member| self.user_was_joined(shortstatehash, &member)) } - _ => { - error!("Unknown history visibility {history_visibility}"); + other => { + error!(kind = %other, "Unknown history visibility"); false } }; @@ -261,8 +261,8 @@ impl Service { // Allow if any member on requested server was joined, else deny self.user_was_joined(shortstatehash, user_id) } - _ => { - error!("Unknown history visibility {history_visibility}"); + other => { + error!(kind = %other, "Unknown history visibility"); false } }; @@ -358,13 +358,9 @@ impl Service { |s| { serde_json::from_str(s.content.get()) .map(|c: RoomNameEventContent| Some(c.name)) - .map_err(|e| { - error!( - "Invalid room name event in database for room {}. \ - {}", - room_id, e - ); - Error::bad_database( + .map_err(|error| { + error!(%error, "Invalid room name event in database"); + Error::BadDatabase( "Invalid room name event in database.", ) })