From 7f27cdbf1ddc497221ef533d52331c513e5e8853 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Fri, 22 Mar 2019 21:00:59 -0700 Subject: [PATCH] modules/federation/state_ids: Seek an event_id before starting chunked encoding to allow 404. --- modules/federation/state_ids.cc | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/modules/federation/state_ids.cc b/modules/federation/state_ids.cc index fde175b31..375cd5c9f 100644 --- a/modules/federation/state_ids.cc +++ b/modules/federation/state_ids.cc @@ -61,6 +61,13 @@ get__state_ids(client &client, room }; + const m::event::auth::chain ac + { + event_id? + m::index(event_id): + m::head_idx(room) + }; + resource::response::chunked response { client, http::OK @@ -94,11 +101,6 @@ get__state_ids(client &client, top, "auth_chain" }; - const m::event::auth::chain ac - { - m::index(event_id) - }; - ac.for_each([&auth_chain] (const m::event::idx &event_idx) {