mirror of
https://github.com/matrix-construct/construct
synced 2024-11-16 15:00:51 +01:00
modules/vm: Move create effects from vm to m_room_create hook.
This commit is contained in:
parent
77d2c06ded
commit
385e08cd62
2 changed files with 11 additions and 7 deletions
|
@ -35,7 +35,18 @@ _can_create_room_hookfn
|
|||
static void
|
||||
_created_room(const m::event &event)
|
||||
{
|
||||
const m::room::id &room_id
|
||||
{
|
||||
at<"room_id"_>(event)
|
||||
};
|
||||
|
||||
const string_view &local
|
||||
{
|
||||
room_id.localname()
|
||||
};
|
||||
|
||||
if(local != "users") //TODO: circ dep
|
||||
send(m::my_room, at<"sender"_>(event), "ircd.room", room_id, json::object{});
|
||||
}
|
||||
|
||||
const m::hook
|
||||
|
|
|
@ -749,11 +749,4 @@ ircd::m::vm::_tmp_effects(const m::event &event)
|
|||
send(room::id{"!public:zemos.net"}, sender, "ircd.room", room_id, {});
|
||||
}
|
||||
|
||||
//TODO: X
|
||||
if(type == "m.room.create")
|
||||
{
|
||||
const string_view local{m::room::id{at<"room_id"_>(event)}.localname()};
|
||||
if(local != "users") //TODO: circ dep
|
||||
send(my_room, at<"sender"_>(event), "ircd.room", at<"room_id"_>(event), json::object{});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue