diff --git a/include/ircd/m/vm.h b/include/ircd/m/vm.h index a2e83896b..942d9226d 100644 --- a/include/ircd/m/vm.h +++ b/include/ircd/m/vm.h @@ -269,6 +269,9 @@ struct ircd::m::vm::copts /// Whether to log an info message after commit accepted bool infolog_postcommit {false}; + + /// Call the issue hook or bypass + bool issue {true}; }; struct ircd::m::vm::error diff --git a/modules/m_room_member.cc b/modules/m_room_member.cc index 45dc3de1b..59946377f 100644 --- a/modules/m_room_member.cc +++ b/modules/m_room_member.cc @@ -218,7 +218,7 @@ const m::hookfn invite_foreign_hookfn { { - { "_site", "vm.commit" }, + { "_site", "vm.issue" }, { "type", "m.room.member" }, { "membership", "invite" }, }, diff --git a/modules/vm.cc b/modules/vm.cc index 925c21584..1d3841587 100644 --- a/modules/vm.cc +++ b/modules/vm.cc @@ -25,7 +25,7 @@ namespace ircd::m::vm static void init(); static void fini(); - extern hook::site commit_hook; ///< Called when this server issues event + extern hook::site issue_hook; ///< Called when this server issues event extern hook::site fetch_hook; ///< Called to resolve dependencies extern hook::site eval_hook; ///< Called when evaluating event extern hook::site post_hook; ///< Called to apply effects pre-notify @@ -57,10 +57,10 @@ ircd::m::vm::log_accept_info { "default", false }, }; -decltype(ircd::m::vm::commit_hook) -ircd::m::vm::commit_hook +decltype(ircd::m::vm::issue_hook) +ircd::m::vm::issue_hook { - { "name", "vm.commit" } + { "name", "vm.issue" } }; decltype(ircd::m::vm::fetch_hook) @@ -469,7 +469,9 @@ try }; check_size(event); - commit_hook(event, eval); + + if(eval.copts->issue) + issue_hook(event, eval); } event::conforms report