0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-18 07:50:57 +01:00

modules/m_room_create: Checkpoint basic condition.

This commit is contained in:
Jason Volk 2018-05-17 19:38:10 -07:00
parent 902d48d702
commit d1f7dd9da6

View file

@ -19,7 +19,21 @@ IRCD_MODULE
static void static void
_can_create_room(const m::event &event) _can_create_room(const m::event &event)
{ {
const m::room::id &room_id
{
at<"room_id"_>(event)
};
const m::user::id &sender
{
at<"sender"_>(event)
};
if(room_id.host() != sender.host())
throw m::ACCESS_DENIED
{
"sender must be on the room_id's host"
};
} }
const m::hook<> const m::hook<>