Remove forJSON

This commit is contained in:
binwiederhier
2026-01-08 11:39:32 -05:00
parent 239959e2a4
commit dffee9ea7d
3 changed files with 9 additions and 15 deletions

View File

@@ -64,16 +64,6 @@ func (m *message) Context() log.Context {
return fields
}
// forJSON returns a copy of the message prepared for JSON output.
// It clears SID if it equals ID (to avoid redundant output).
func (m *message) forJSON() *message {
msg := *m
if msg.SID == msg.ID {
msg.SID = "" // Will be omitted due to omitempty
}
return &msg
}
type attachment struct {
Name string `json:"name"`
Type string `json:"type,omitempty"`
@@ -560,7 +550,7 @@ func newWebPushPayload(subscriptionID string, message *message) *webPushPayload
return &webPushPayload{
Event: webPushMessageEvent,
SubscriptionID: subscriptionID,
Message: message.forJSON(),
Message: message,
}
}