mirror of
https://github.com/matrix-construct/construct
synced 2024-11-29 10:12:39 +01:00
ircd:Ⓜ️:room: Add central interface linkage for room::purge().
This commit is contained in:
parent
3018062345
commit
1ffa00adbf
4 changed files with 25 additions and 10 deletions
|
@ -108,6 +108,8 @@ struct ircd::m::room
|
|||
// Index of create event
|
||||
static event::idx index(const id &, std::nothrow_t);
|
||||
static event::idx index(const id &);
|
||||
|
||||
static size_t purge(const room &); // cuidado!
|
||||
};
|
||||
|
||||
inline ircd::m::room::operator
|
||||
|
|
13
ircd/m.cc
13
ircd/m.cc
|
@ -4036,6 +4036,19 @@ ircd::m::user::ignores::enforce(const string_view &type)
|
|||
// m/room.h
|
||||
//
|
||||
|
||||
size_t
|
||||
ircd::m::room::purge(const room &room)
|
||||
{
|
||||
using prototype = size_t (const m::room &);
|
||||
|
||||
static mods::import<prototype> call
|
||||
{
|
||||
"m_room", "ircd::m::room::purge"
|
||||
};
|
||||
|
||||
return call(room);
|
||||
}
|
||||
|
||||
bool
|
||||
ircd::m::room::state::force_present(const event &event)
|
||||
{
|
||||
|
|
|
@ -8271,9 +8271,14 @@ console_cmd__room__id(opt &out, const string_view &id)
|
|||
bool
|
||||
console_cmd__room__purge(opt &out, const string_view &line)
|
||||
{
|
||||
const params param{line, " ",
|
||||
{
|
||||
"room_id",
|
||||
}};
|
||||
|
||||
const auto &room_id
|
||||
{
|
||||
m::room_id(token(line, ' ', 0))
|
||||
m::room_id(param.at(0))
|
||||
};
|
||||
|
||||
const m::room room
|
||||
|
@ -8281,15 +8286,9 @@ console_cmd__room__purge(opt &out, const string_view &line)
|
|||
room_id
|
||||
};
|
||||
|
||||
using prototype = size_t (const m::room &);
|
||||
static mods::import<prototype> purge
|
||||
{
|
||||
"m_room", "purge"
|
||||
};
|
||||
|
||||
const size_t ret
|
||||
{
|
||||
purge(room)
|
||||
m::room::purge(room)
|
||||
};
|
||||
|
||||
out << "erased " << ret << std::endl;
|
||||
|
|
|
@ -222,8 +222,9 @@ ircd::m::room::origins::random(const origins &origins,
|
|||
return ret;
|
||||
}
|
||||
|
||||
extern "C" size_t
|
||||
purge(const m::room &room)
|
||||
size_t
|
||||
IRCD_MODULE_EXPORT
|
||||
ircd::m::room::purge(const room &room)
|
||||
{
|
||||
size_t ret(0);
|
||||
db::txn txn
|
||||
|
|
Loading…
Reference in a new issue