mirror of
https://github.com/matrix-construct/construct
synced 2025-01-16 01:26:58 +01:00
ircd:Ⓜ️ Add vm_notify hook::site; add hook to create public rooms room.
This commit is contained in:
parent
5dbafa6a21
commit
e7b6f4bac6
2 changed files with 26 additions and 3 deletions
|
@ -197,6 +197,11 @@ ircd::m::vm::commit(json::iov &iov)
|
||||||
|
|
||||||
namespace ircd::m::vm
|
namespace ircd::m::vm
|
||||||
{
|
{
|
||||||
|
hook::site notify_hook
|
||||||
|
{
|
||||||
|
{ "name", "vm notify" }
|
||||||
|
};
|
||||||
|
|
||||||
void write(eval &);
|
void write(eval &);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -84,8 +84,26 @@ get_method
|
||||||
publicrooms_resource, "GET", get__publicrooms
|
publicrooms_resource, "GET", get__publicrooms
|
||||||
};
|
};
|
||||||
|
|
||||||
resource::method
|
static void
|
||||||
post_method
|
_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
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue