0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-26 15:33:54 +01:00

ircd:Ⓜ️ Optimize user::rooms iteration event query.

This commit is contained in:
Jason Volk 2018-05-21 00:19:27 -07:00
parent 2755d779c9
commit bc26a8f9b3

View file

@ -2132,8 +2132,27 @@ ircd::m::user::rooms::for_each(const string_view &membership,
const closure_bool &closure)
const
{
// Setup the list of event fields to fetch for the closure
static const event::keys keys
{
event::keys::include
{
"event_id",
"state_key",
"content",
}
};
const m::event::fetch::opts fopts
{
keys, user_room.fopts? user_room.fopts->gopts : db::gopts{}
};
const m::room::state state
{
user_room, &fopts
};
const m::room::state state{user_room};
state.test("ircd.member", [&membership, &closure]
(const m::event &event)
{