diff --git a/include/ircd/m/vm.h b/include/ircd/m/vm.h index 4e5fa529e..1d9dfe518 100644 --- a/include/ircd/m/vm.h +++ b/include/ircd/m/vm.h @@ -120,8 +120,15 @@ struct ircd::m::vm::opts /// Apply effects of the eval bool effects {true}; - /// Broadcast to clients/servers - bool notify {true}; + /// Broadcast to clients/servers. When true, individual notify options + /// that follow are considered. When false, no notifications occur. + short notify {true}; + + /// Broadcast to local clients (/sync stream). + bool notify_clients {true}; + + /// Broadcast to federation servers (/federation/send/). + bool notify_servers {true}; /// False to allow a dirty conforms report (not recommended). bool conforming {true}; diff --git a/modules/client/sync.cc b/modules/client/sync.cc index 0774f843f..f71dce2de 100644 --- a/modules/client/sync.cc +++ b/modules/client/sync.cc @@ -343,6 +343,10 @@ try m::vm::accept.wait_until(lock, args.timesout) }; + assert(accepted.opts); + if(!accepted.opts->notify_clients) + continue; + if(synchronize(client, request, args, accepted)) return; } diff --git a/modules/federation/sender.cc b/modules/federation/sender.cc index 878c43278..0e934e6ea 100644 --- a/modules/federation/sender.cc +++ b/modules/federation/sender.cc @@ -70,8 +70,14 @@ send_worker() m::vm::accept.wait(lock) }; - if(my(event)) - send(event); + if(!my(event)) + continue; + + assert(event.opts); + if(!event.opts->notify_servers) + continue; + + send(event); } catch(const std::exception &e) {