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:
parent
902d48d702
commit
d1f7dd9da6
1 changed files with 14 additions and 0 deletions
|
@ -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<>
|
||||||
|
|
Loading…
Reference in a new issue