mirror of
https://github.com/matrix-construct/construct
synced 2024-11-29 02:02:38 +01:00
ircd:Ⓜ️:room::events::missing: Add count() to interface.
This commit is contained in:
parent
56d80751ec
commit
3d5b2ca262
2 changed files with 17 additions and 0 deletions
|
@ -109,6 +109,7 @@ struct ircd::m::room::events::missing
|
|||
|
||||
public:
|
||||
bool for_each(const closure &) const;
|
||||
size_t count() const;
|
||||
|
||||
missing() = default;
|
||||
missing(const m::room &room)
|
||||
|
|
|
@ -174,6 +174,22 @@ ircd::m::room::events::count(const m::room &room,
|
|||
// room::events::missing
|
||||
//
|
||||
|
||||
size_t
|
||||
IRCD_MODULE_EXPORT
|
||||
ircd::m::room::events::missing::count()
|
||||
const
|
||||
{
|
||||
size_t ret{0};
|
||||
for_each([&ret]
|
||||
(const auto &event_id, const auto &depth, const auto &event_idx)
|
||||
{
|
||||
++ret;
|
||||
return true;
|
||||
});
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool
|
||||
IRCD_MODULE_EXPORT
|
||||
ircd::m::room::events::missing::for_each(const closure &closure)
|
||||
|
|
Loading…
Reference in a new issue