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

Function BuildNotification

internal/ws/handler.go:182–193  ·  view source on GitHub ↗

BuildNotification creates a lightweight JSON notification from a message.

(msg *identity.Message)

Source from the content-addressed store, hash-verified

180
181// BuildNotification creates a lightweight JSON notification from a message.
182func BuildNotification(msg *identity.Message) []byte {
183 n := Notification{
184 MessageID: msg.ID,
185 ConversationID: msg.ConversationID,
186 From: msg.Sender,
187 Recipient: msg.Recipient,
188 Subject: msg.Subject,
189 ReceivedAt: msg.CreatedAt,
190 }
191 data, _ := json.Marshal(n)
192 return data
193}
194
195// readLoop blocks until the client disconnects or sends a close frame.
196// It ignores client messages and sends periodic pings.

Callers 4

buildWSNotificationFunction · 0.92
drainUnreadMethod · 0.85
TestBuildNotificationFunction · 0.85

Calls

no outgoing calls