diff --git a/include/ircd/m/room.h b/include/ircd/m/room.h index fc1ea1846..4aab97d94 100644 --- a/include/ircd/m/room.h +++ b/include/ircd/m/room.h @@ -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; diff --git a/ircd/m/room.cc b/ircd/m/room.cc index 15c29b17c..f79a63ed4 100644 --- a/ircd/m/room.cc +++ b/ircd/m/room.cc @@ -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 //