pub async fn emit(
conn: &mut PgConnection,
actor: Option<&Actor>,
event: WebhookEvent,
projects: &[Option<Uuid>],
objects: Value,
) -> AppResult<u64>Expand description
Queues an event for every active webhook that subscribed to it and whose
project group (if any) is one of projects. Call it inside the event’s
transaction. Returns the number of deliveries queued.
A webhook limited to a project group receives only the entries of a
top-level revisions list that belong to its group (a change can hold
revisions of several groups; the other groups’ items are none of that
receiver’s business).
Read access: each webhook is a reader that sees its own project group and the internal groups (a global webhook: the internal groups only), so an event that touches a restricted group reaches only webhooks scoped to that group.