From ebdbc0864c6f9cfe8b308d62bd0d16c15d2eb40b Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Thu, 11 Apr 2019 08:08:47 -0700 Subject: [PATCH] modules/s_fetch: Enable recursive fetch. --- modules/console.cc | 1 + modules/federation/send.cc | 1 - modules/s_fetch.cc | 18 ++++++++---------- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/modules/console.cc b/modules/console.cc index fee7f36c9..1d563cd36 100644 --- a/modules/console.cc +++ b/modules/console.cc @@ -11143,6 +11143,7 @@ console_cmd__fed__event(opt &out, const string_view &line) m::vm::opts vmopts; vmopts.non_conform.set(m::event::conforms::MISSING_PREV_STATE); vmopts.prev_check_exists = true; + vmopts.prev_wait = true; vmopts.state_must_exist = true; vmopts.history = false; vmopts.notify = false; diff --git a/modules/federation/send.cc b/modules/federation/send.cc index fe24412cd..707887a24 100644 --- a/modules/federation/send.cc +++ b/modules/federation/send.cc @@ -72,7 +72,6 @@ handle_pdus(client &client, { m::vm::opts vmopts; vmopts.non_conform.set(m::event::conforms::MISSING_PREV_STATE); - vmopts.prev_check_exists = false; vmopts.nothrows = -1U; vmopts.infolog_accept = true; vmopts.warnlog |= m::vm::fault::STATE; diff --git a/modules/s_fetch.cc b/modules/s_fetch.cc index e34ec342c..90c6ef96b 100644 --- a/modules/s_fetch.cc +++ b/modules/s_fetch.cc @@ -143,15 +143,14 @@ ircd::m::fetch::hook_handler(const event &event, continue; } - if(!opts.prev_fetch || !opts.prev_wait) - if(opts.prev_must_all_exist) - throw vm::error - { - vm::fault::EVENT, "Missing prev %s in %s in %s", - string_view{prev_id}, - json::get<"event_id"_>(*eval.event_), - json::get<"room_id"_>(*eval.event_) - }; + if((!opts.prev_fetch || !opts.prev_wait) && opts.prev_must_all_exist) + throw vm::error + { + vm::fault::EVENT, "Missing prev %s in %s in %s", + string_view{prev_id}, + json::get<"event_id"_>(*eval.event_), + json::get<"room_id"_>(*eval.event_) + }; if(opts.prev_fetch) start(prev_id, room_id); @@ -520,7 +519,6 @@ try }; m::vm::opts opts; - opts.prev_check_exists = false; opts.infolog_accept = true; m::vm::eval {