mirror of
https://github.com/matrix-construct/construct
synced 2024-11-26 08:42:34 +01:00
ircd:Ⓜ️ Add count() interface to room::state.
This commit is contained in:
parent
4818409b51
commit
191167f7ba
2 changed files with 18 additions and 0 deletions
|
@ -188,6 +188,10 @@ struct ircd::m::room::state
|
|||
bool test(const event::id::closure_bool &view) const;
|
||||
bool test(const event::closure_bool &view) const;
|
||||
|
||||
// Counting / Statistics
|
||||
size_t count(const string_view &type) const;
|
||||
size_t count() const;
|
||||
|
||||
// Existential
|
||||
bool has(const string_view &type, const string_view &state_key) const;
|
||||
bool has(const string_view &type) const;
|
||||
|
|
|
@ -427,6 +427,20 @@ const
|
|||
});
|
||||
}
|
||||
|
||||
size_t
|
||||
ircd::m::room::state::count()
|
||||
const
|
||||
{
|
||||
return m::state::count(root_id);
|
||||
}
|
||||
|
||||
size_t
|
||||
ircd::m::room::state::count(const string_view &type)
|
||||
const
|
||||
{
|
||||
return m::state::count(root_id, type);
|
||||
}
|
||||
|
||||
bool
|
||||
ircd::m::room::state::test(const event::closure_bool &closure)
|
||||
const
|
||||
|
|
Loading…
Reference in a new issue