MCPcopy Create free account
hub / github.com/Mnexa-AI/e2a / buildInboundRejectedEvent

Method buildInboundRejectedEvent

internal/agent/webhooks_api.go:196–213  ·  view source on GitHub ↗

buildInboundRejectedEvent fires when a reviewer drops a held inbound message (status pending_review → review_rejected; it stays hidden from the agent and its raw payload is retained for forensics — design §4.4). Routing key is the agent owner (see buildInboundReleasedEvent).

(msg *identity.ReviewMessageMeta, ownerUserID, reviewerUserID, reason string)

Source from the content-addressed store, hash-verified

194// its raw payload is retained for forensics — design §4.4). Routing key is the
195// agent owner (see buildInboundReleasedEvent).
196func (a *API) buildInboundRejectedEvent(msg *identity.ReviewMessageMeta, ownerUserID, reviewerUserID, reason string) webhookpub.Event {
197 data := map[string]interface{}{
198 "message_id": msg.ID,
199 "direction": "inbound",
200 "type": msg.Type,
201 "rejection_reason": reason,
202 "reviewed_by_user_id": reviewerUserID,
203 }
204 return webhookpub.Event{
205 ID: generateEventIDForAgent(),
206 Type: webhookpub.EventEmailReviewRejected,
207 CreatedAt: time.Now().UTC(),
208 UserID: ownerUserID,
209 AgentID: msg.AgentID,
210 MessageID: msg.ID,
211 Data: data,
212 }
213}
214
215// generateEventIDForAgent wraps webhookpub's id helper so this file
216// doesn't need to import internal/webhookpub just for the constructor.

Calls 1

generateEventIDForAgentFunction · 0.85

Tested by 1