0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-09-29 12:18:54 +02:00

ircd:Ⓜ️ Provide event_idx for event after gap to closure.

This commit is contained in:
Jason Volk 2019-04-26 00:52:04 -07:00
parent e3e9322718
commit ba797778d6
3 changed files with 4 additions and 4 deletions

View file

@ -25,7 +25,7 @@ namespace ircd::m
// have been obtained at that depth. Each gap is reported to the closure
// with a separate invocation. The range is [inclusive, exclusive].
using depth_range = std::pair<int64_t, int64_t>;
using depth_range_closure = std::function<bool (const depth_range &)>;
using depth_range_closure = std::function<bool (const depth_range &, const event::idx &)>;
bool for_each_depth_gap(const room &, const depth_range_closure &);
bool rfor_each_depth_gap(const room &, const depth_range_closure &);
std::pair<bool, int64_t> is_complete(const room &);

View file

@ -7436,7 +7436,7 @@ console_cmd__room__depth__gaps(opt &out, const string_view &line)
};
const auto closure{[&out]
(const auto &range)
(const auto &range, const auto &event_idx)
{
out << std::right << std::setw(8) << range.first
<< " : "

View file

@ -519,7 +519,7 @@ ircd::m::rfor_each_depth_gap(const room &room,
if(range.first == range.second)
continue;
if(!closure({range.first+1, range.second+1}))
if(!closure({range.first+1, range.second+1}, it.event_idx()))
return false;
range.second = range.first;
@ -548,7 +548,7 @@ ircd::m::for_each_depth_gap(const room &room,
if(range.first == range.second)
continue;
if(!closure(range))
if(!closure(range, it.event_idx()))
return false;
range.first = range.second;