From 385e08cd6260e74c55f84d5b7e75af17fd7e59b2 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Sat, 12 May 2018 20:19:17 -0700 Subject: [PATCH] modules/vm: Move create effects from vm to m_room_create hook. --- modules/m_room_create.cc | 11 +++++++++++ modules/vm.cc | 7 ------- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/modules/m_room_create.cc b/modules/m_room_create.cc index ce4480bf7..76a58f843 100644 --- a/modules/m_room_create.cc +++ b/modules/m_room_create.cc @@ -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 diff --git a/modules/vm.cc b/modules/vm.cc index e1624b373..3bd85daf3 100644 --- a/modules/vm.cc +++ b/modules/vm.cc @@ -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{}); - } }