annotateAndAudit denormalizes the verdict onto the (already-created) message row and writes the audit rows. Used on the flag (sent) and review (held) paths once the row id is known.
(ctx context.Context, agent *identity.AgentIdentity, messageID string, req outbound.SendRequest, v outboundVerdict)
| 270 | // row and writes the audit rows. Used on the flag (sent) and review (held) paths |
| 271 | // once the row id is known. |
| 272 | func (a *API) annotateAndAudit(ctx context.Context, agent *identity.AgentIdentity, messageID string, req outbound.SendRequest, v outboundVerdict) { |
| 273 | if err := a.store.SetMessageScreening(ctx, messageID, agent.ID, v.ReviewReason, v.ScanScore, string(v.Applied)); err != nil { |
| 274 | log.Printf("[mail:%s] set screening denorm failed: %v", messageID, err) |
| 275 | } |
| 276 | a.writeProtectionEvents(ctx, messageID, v.screeningEvents(messageID, agent)) |
| 277 | } |
| 278 | |
| 279 | // auditRowless writes the audit rows WITHOUT denormalizing a message row — for |
| 280 | // outbound paths that persist no message row: a blocked (refused) send, and a |
no test coverage detected