0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-29 10:12:39 +01:00

ircd:Ⓜ️ Add the m::room::has(type, state_key) passthru.

This commit is contained in:
Jason Volk 2018-02-10 21:42:16 -08:00
parent e3c419d25d
commit 3e603b86e9
2 changed files with 10 additions and 0 deletions

View file

@ -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;

View file

@ -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
//