mirror of
https://github.com/matrix-construct/construct
synced 2024-11-29 18:22:50 +01:00
ircd:Ⓜ️ Add the m::room::has(type, state_key) passthru.
This commit is contained in:
parent
e3c419d25d
commit
3e603b86e9
2 changed files with 10 additions and 0 deletions
|
@ -87,6 +87,7 @@ struct ircd::m::room
|
|||
operator const id &() const { return room_id; }
|
||||
|
||||
// Convenience passthru to room::state (logarithmic query)
|
||||
bool has(const string_view &type, const string_view &state_key) const;
|
||||
bool get(std::nothrow_t, const string_view &type, const string_view &state_key, const event::closure &) const;
|
||||
void get(const string_view &type, const string_view &state_key, const event::closure &) const;
|
||||
|
||||
|
|
|
@ -363,6 +363,15 @@ const
|
|||
return state.get(std::nothrow, type, state_key, closure);
|
||||
}
|
||||
|
||||
bool
|
||||
ircd::m::room::has(const string_view &type,
|
||||
const string_view &state_key)
|
||||
const
|
||||
{
|
||||
const state state{*this};
|
||||
return state.has(type, state_key);
|
||||
}
|
||||
|
||||
//
|
||||
// room::messages
|
||||
//
|
||||
|
|
Loading…
Reference in a new issue