summaryrefslogtreecommitdiff
path: root/src/api/client_server/room.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/api/client_server/room.rs')
-rw-r--r--src/api/client_server/room.rs12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/api/client_server/room.rs b/src/api/client_server/room.rs
index 5c98028..56bdf03 100644
--- a/src/api/client_server/room.rs
+++ b/src/api/client_server/room.rs
@@ -425,10 +425,14 @@ pub async fn get_room_event_route(
) -> Result<get_room_event::v3::Response> {
let sender_user = body.sender_user.as_ref().expect("user is authenticated");
- let event = services().rooms.timeline.get_pdu(&body.event_id)?.ok_or({
- warn!("Event not found, event ID: {:?}", &body.event_id);
- Error::BadRequest(ErrorKind::NotFound, "Event not found.")
- })?;
+ let event = services()
+ .rooms
+ .timeline
+ .get_pdu(&body.event_id)?
+ .ok_or_else(|| {
+ warn!("Event not found, event ID: {:?}", &body.event_id);
+ Error::BadRequest(ErrorKind::NotFound, "Event not found.")
+ })?;
if !services().rooms.state_accessor.user_can_see_event(
sender_user,