mirror of
https://github.com/matrix-construct/construct
synced 2024-11-26 08:42:34 +01:00
modules/client/rooms/report: Create !abuse room with !ircd init hook.
This commit is contained in:
parent
4e618175c7
commit
2158d3e7b6
1 changed files with 16 additions and 7 deletions
|
@ -12,6 +12,8 @@
|
|||
|
||||
using namespace ircd;
|
||||
|
||||
static void create_report_room(const m::event &, m::vm::eval &);
|
||||
|
||||
const m::room::id::buf
|
||||
report_room_id
|
||||
{
|
||||
|
@ -25,6 +27,17 @@ reason_max
|
|||
{ "default", 512L }
|
||||
};
|
||||
|
||||
const m::hookfn<m::vm::eval &>
|
||||
create_report_room_hook
|
||||
{
|
||||
create_report_room,
|
||||
{
|
||||
{ "_site", "vm.effect" },
|
||||
{ "room_id", "!ircd" },
|
||||
{ "type", "m.room.create" },
|
||||
}
|
||||
};
|
||||
|
||||
resource::response
|
||||
post__report(client &client,
|
||||
const resource::request &request,
|
||||
|
@ -90,13 +103,9 @@ post__report(client &client,
|
|||
};
|
||||
}
|
||||
|
||||
struct create_report_room
|
||||
{
|
||||
create_report_room();
|
||||
}
|
||||
static create_report_room;
|
||||
|
||||
create_report_room::create_report_room()
|
||||
void
|
||||
create_report_room(const m::event &,
|
||||
m::vm::eval &)
|
||||
try
|
||||
{
|
||||
if(m::exists(report_room_id))
|
||||
|
|
Loading…
Reference in a new issue