0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-25 16:22:35 +01:00

ircd:Ⓜ️:room::state: Move rebuild iterations out from interface.

This commit is contained in:
Jason Volk 2019-08-22 08:02:17 -07:00
parent 5a22fa7370
commit 8ad0d46cff
4 changed files with 22 additions and 28 deletions

View file

@ -106,5 +106,4 @@ struct ircd::m::room::state
struct ircd::m::room::state::rebuild
{
rebuild(const room::id &);
rebuild();
};

View file

@ -45,5 +45,4 @@ struct ircd::m::room::state::space
struct ircd::m::room::state::space::rebuild
{
rebuild(const room::id &);
rebuild();
};

View file

@ -36,17 +36,6 @@ ircd::m::room::purge(const room &room)
return ret;
}
ircd::m::room::state::rebuild::rebuild()
{
rooms::opts opts;
opts.remote_joined_only = true;
rooms::for_each(opts, [](const auto &room_id)
{
rebuild{room_id};
return true;
});
}
ircd::m::room::state::rebuild::rebuild(const room::id &room_id)
{
const m::event::id::buf event_id
@ -3007,17 +2996,6 @@ const
// room::state::space::rebuild
//
ircd::m::room::state::space::rebuild::rebuild()
{
rooms::opts opts;
opts.remote_joined_only = true;
rooms::for_each(opts, [](const auto &room_id)
{
rebuild{room_id};
return true;
});
}
ircd::m::room::state::space::rebuild::rebuild(const room::id &room_id)
{
db::txn txn

View file

@ -9179,10 +9179,28 @@ console_cmd__room__state__space__rebuild(opt &out, const string_view &line)
m::room::id::buf{}
};
if(room_id)
m::room::state::space::rebuild{room_id};
else
m::room::state::space::rebuild{};
if(room_id == "*" || room_id == "remote_joined_only")
{
m::rooms::opts opts;
opts.remote_joined_only = room_id == "remote_joined_only";
m::rooms::for_each(opts, []
(const m::room::id &room_id)
{
m::room::state::space::rebuild
{
room_id
};
return true;
});
return true;
}
m::room::state::space::rebuild
{
room_id
};
return true;
}