mirror of
https://github.com/matrix-construct/construct
synced 2024-11-17 07:20:55 +01:00
ircd:Ⓜ️ Provide event_idx for event after gap to closure.
This commit is contained in:
parent
e3e9322718
commit
ba797778d6
3 changed files with 4 additions and 4 deletions
|
@ -25,7 +25,7 @@ namespace ircd::m
|
||||||
// have been obtained at that depth. Each gap is reported to the closure
|
// have been obtained at that depth. Each gap is reported to the closure
|
||||||
// with a separate invocation. The range is [inclusive, exclusive].
|
// with a separate invocation. The range is [inclusive, exclusive].
|
||||||
using depth_range = std::pair<int64_t, int64_t>;
|
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 for_each_depth_gap(const room &, const depth_range_closure &);
|
||||||
bool rfor_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 &);
|
std::pair<bool, int64_t> is_complete(const room &);
|
||||||
|
|
|
@ -7436,7 +7436,7 @@ console_cmd__room__depth__gaps(opt &out, const string_view &line)
|
||||||
};
|
};
|
||||||
|
|
||||||
const auto closure{[&out]
|
const auto closure{[&out]
|
||||||
(const auto &range)
|
(const auto &range, const auto &event_idx)
|
||||||
{
|
{
|
||||||
out << std::right << std::setw(8) << range.first
|
out << std::right << std::setw(8) << range.first
|
||||||
<< " : "
|
<< " : "
|
||||||
|
|
|
@ -519,7 +519,7 @@ ircd::m::rfor_each_depth_gap(const room &room,
|
||||||
if(range.first == range.second)
|
if(range.first == range.second)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if(!closure({range.first+1, range.second+1}))
|
if(!closure({range.first+1, range.second+1}, it.event_idx()))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
range.second = range.first;
|
range.second = range.first;
|
||||||
|
@ -548,7 +548,7 @@ ircd::m::for_each_depth_gap(const room &room,
|
||||||
if(range.first == range.second)
|
if(range.first == range.second)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if(!closure(range))
|
if(!closure(range, it.event_idx()))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
range.first = range.second;
|
range.first = range.second;
|
||||||
|
|
Loading…
Reference in a new issue