mirror of
https://github.com/matrix-construct/construct
synced 2025-01-15 17:16:49 +01:00
modules/s_fetch: Use vm::eval array constructor here.
This commit is contained in:
parent
c8df604d24
commit
6335a0ce09
1 changed files with 5 additions and 14 deletions
|
@ -462,19 +462,11 @@ ircd::m::fetch::auth_chain(const room &room,
|
||||||
|
|
||||||
request.wait(seconds(auth_timeout)); //TODO: conf
|
request.wait(seconds(auth_timeout)); //TODO: conf
|
||||||
request.get();
|
request.get();
|
||||||
const json::array &array
|
const json::array &events
|
||||||
{
|
{
|
||||||
request
|
request
|
||||||
};
|
};
|
||||||
|
|
||||||
std::vector<json::object> events(array.count());
|
|
||||||
std::copy(begin(array), end(array), begin(events));
|
|
||||||
std::sort(begin(events), end(events), []
|
|
||||||
(const json::object &a, const json::object &b)
|
|
||||||
{
|
|
||||||
return a.at<uint64_t>("depth") < b.at<uint64_t>("depth");
|
|
||||||
});
|
|
||||||
|
|
||||||
log::debug
|
log::debug
|
||||||
{
|
{
|
||||||
log, "Evaluating %zu auth events in chain for %s in %s from %s",
|
log, "Evaluating %zu auth events in chain for %s in %s from %s",
|
||||||
|
@ -488,11 +480,10 @@ ircd::m::fetch::auth_chain(const room &room,
|
||||||
vmopts.infolog_accept = true;
|
vmopts.infolog_accept = true;
|
||||||
vmopts.fetch_prev_check = false;
|
vmopts.fetch_prev_check = false;
|
||||||
vmopts.fetch_state_check = false;
|
vmopts.fetch_state_check = false;
|
||||||
for(const auto &event : events)
|
m::vm::eval
|
||||||
m::vm::eval
|
{
|
||||||
{
|
events, vmopts
|
||||||
m::event{event}, vmopts
|
};
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
|
|
Loading…
Reference in a new issue