0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-25 23:14:13 +01:00

ircd:Ⓜ️:vm: More granular notification broadcast options.

This commit is contained in:
Jason Volk 2018-05-27 19:56:04 -07:00
parent 7bbcf63d8a
commit 88d3026cc7
3 changed files with 21 additions and 4 deletions

View file

@ -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};

View file

@ -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;
}

View file

@ -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)
{