0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-27 07:54:05 +01:00

ircd:Ⓜ️ Add vm_notify hook::site; add hook to create public rooms room.

This commit is contained in:
Jason Volk 2018-02-26 00:13:58 -08:00
parent 5dbafa6a21
commit e7b6f4bac6
2 changed files with 26 additions and 3 deletions

View file

@ -197,6 +197,11 @@ ircd::m::vm::commit(json::iov &iov)
namespace ircd::m::vm
{
hook::site notify_hook
{
{ "name", "vm notify" }
};
void write(eval &);
}

View file

@ -84,8 +84,26 @@ get_method
publicrooms_resource, "GET", get__publicrooms
};
resource::method
post_method
static void
_create_public_room(const m::event &)
{
publicrooms_resource, "POST", post__publicrooms
if(!exists(public_room_id))
m::create(public_room_id, m::me.user_id);
}
/// Create the public rooms room at the appropriate time on startup.
/// The startup event chosen here is when @ircd joins the !ircd room,
/// which is a fundamental notification toward the end of init.
const m::hook
_create_public_hook
{
{
{ "_site", "vm notify" },
{ "room_id", "!ircd:zemos.net" },
{ "sender", "@ircd:zemos.net" },
{ "type", "m.room.member" },
{ "membership", "join" },
},
_create_public_room
};