diff --git a/include/ircd/m/room/missing.h b/include/ircd/m/room/missing.h index 297f71ff9..b9bae9b4e 100644 --- a/include/ircd/m/room/missing.h +++ b/include/ircd/m/room/missing.h @@ -28,7 +28,7 @@ struct ircd::m::room::missing m::room room; private: - bool _each(m::room::events &, const closure &) const; + bool _each(m::room::events &, m::event::fetch &, const closure &) const; public: bool rfor_each(const pair &depth, const closure &) const; diff --git a/matrix/room_missing.cc b/matrix/room_missing.cc index dfe0a05fc..8edda4998 100644 --- a/matrix/room_missing.cc +++ b/matrix/room_missing.cc @@ -40,12 +40,13 @@ const room, uint64_t(depth.first) }; + m::event::fetch event; for(; it; ++it) { if(depth.second && int64_t(it.depth()) > depth.second) break; - if(!_each(it, closure)) + if(!_each(it, event, closure)) return false; } @@ -62,6 +63,7 @@ const room, depth.second?: -1UL }; + m::event::fetch event; for(; it; --it) { if(depth.second && int64_t(it.depth()) > depth.second) @@ -70,7 +72,7 @@ const if(int64_t(it.depth()) < depth.first) break; - if(!_each(it, closure)) + if(!_each(it, event, closure)) return false; } @@ -79,6 +81,7 @@ const bool ircd::m::room::missing::_each(m::room::events &it, + m::event::fetch &event, const closure &closure) const { @@ -87,10 +90,8 @@ const *it }; - const m::event::fetch event - { - std::nothrow, event_idx - }; + if(!seek(std::nothrow, event, event_idx)) + return true; const event::prev prev {