0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2025-01-14 00:34:18 +01:00

ircd:Ⓜ️:room::state: Remove cruft.

This commit is contained in:
Jason Volk 2019-08-22 02:38:29 -07:00
parent ac08202346
commit 118efe5cc7
3 changed files with 0 additions and 61 deletions

View file

@ -98,7 +98,6 @@ struct ircd::m::room::state
static size_t prefetch(const state &, const string_view &, const event::idx_range &);
static bool present(const event::idx &);
static size_t rebuild_present(const room::id &);
static bool force_present(const event &);
static size_t purge_replaced(const room::id &);
static bool is(std::nothrow_t, const event::idx &);
static bool is(const event::idx &);

View file

@ -95,39 +95,6 @@ ircd::m::room::state::purge_replaced(const room::id &room_id)
return ret;
}
bool
ircd::m::room::state::force_present(const m::event &event)
{
db::txn txn
{
*m::dbs::events
};
if(!defined(json::get<"room_id"_>(event)))
throw error
{
"event %s is not a room event (no room_id)",
string_view{event.event_id}
};
if(!defined(json::get<"state_key"_>(event)))
throw error
{
"event %s is not a state event (no state_key)",
string_view{event.event_id}
};
dbs::write_opts opts;
opts.event_idx = m::index(event);
opts.appendix.reset();
opts.appendix.set(dbs::appendix::ROOM_STATE);
opts.appendix.reset(dbs::appendix::ROOM_JOINED);
dbs::write(txn, event, opts);
txn();
return true;
}
size_t
ircd::m::room::state::rebuild_present(const room::id &room_id)
{

View file

@ -9171,33 +9171,6 @@ console_cmd__room__state__space__rebuild(opt &out, const string_view &line)
return true;
}
bool
console_cmd__room__state__force(opt &out, const string_view &line)
{
const params param{line, " ",
{
"event_id"
}};
const m::event::id &event_id
{
param.at(0)
};
const m::event::fetch event
{
event_id
};
const auto res
{
m::room::state::force_present(event)
};
out << "forced " << event_id << " into present state" << std::endl;
return true;
}
bool
console_cmd__room__state__purge__replaced(opt &out, const string_view &line)
{