Skip to content

Commit e551248

Browse files
committed
Rename to use delete_contact
1 parent 969b4cb commit e551248

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

Diff for: channel_event.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const (
2121
EventTypeWelcomeMessage ChannelEventType = "welcome_message"
2222
EventTypeOptIn ChannelEventType = "optin"
2323
EventTypeOptOut ChannelEventType = "optout"
24-
EventDeletionRequest ChannelEventType = "delete_request"
24+
EventDeleteContact ChannelEventType = "delete_contact"
2525
)
2626

2727
//-----------------------------------------------------------------------------

Diff for: handlers/meta/facebook_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ func TestDeleteRequest(t *testing.T) {
336336
NoInvalidChannelCheck: true,
337337
NoLogsExpected: true,
338338
ExpectedEvents: []ExpectedEvent{
339-
{Type: courier.EventDeletionRequest, URN: "facebook:218471", Extra: map[string]string{"userID": "218471"}},
339+
{Type: courier.EventDeleteContact, URN: "facebook:218471", Extra: map[string]string{"userID": "218471"}},
340340
},
341341
},
342342
{

Diff for: handlers/meta/handlers.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ func (h *handler) Initialize(s courier.Server) error {
8787
h.SetServer(s)
8888
s.AddHandlerRoute(h, http.MethodGet, "receive", courier.ChannelLogTypeWebhookVerify, h.receiveVerify)
8989
s.AddHandlerRoute(h, http.MethodPost, "receive", courier.ChannelLogTypeMultiReceive, handlers.JSONPayload(h, h.receiveEvents))
90-
s.AddHandlerRoute(h, http.MethodPost, "delete", courier.ChannelLogTypeEventReceive, handlers.JSONPayload(h, h.deleteEvents))
90+
s.AddHandlerRoute(h, http.MethodPost, "delete", courier.ChannelLogTypeEventReceive, handlers.JSONPayload(h, h.deleteContactEvents))
9191
return nil
9292
}
9393

@@ -229,8 +229,8 @@ type DeleteConfirmationData struct {
229229
ConfirmationCode string `json:"confirmation_code"`
230230
}
231231

232-
// deleteEvents is our HTTP handler function for deleting data requests
233-
func (h *handler) deleteEvents(ctx context.Context, channel courier.Channel, w http.ResponseWriter, r *http.Request, payload *DeletionRequestData, clog *courier.ChannelLog) ([]courier.Event, error) {
232+
// deleteContactEvents is our HTTP handler function for deleting data requests
233+
func (h *handler) deleteContactEvents(ctx context.Context, channel courier.Channel, w http.ResponseWriter, r *http.Request, payload *DeletionRequestData, clog *courier.ChannelLog) ([]courier.Event, error) {
234234
err := h.validateSignature(r)
235235
if err != nil {
236236
return nil, handlers.WriteAndLogRequestError(ctx, h, channel, w, r, err)
@@ -248,7 +248,7 @@ func (h *handler) deleteEvents(ctx context.Context, channel courier.Channel, w h
248248
payloadJson, _ := json.Marshal(payload)
249249
sentry.CaptureMessage(fmt.Sprintf("Data Deletion Request: %s", payloadJson))
250250

251-
event := h.Backend().NewChannelEvent(channel, courier.EventDeletionRequest, urn, clog).WithOccurredOn(date).WithExtra(map[string]string{"userID": payload.UserID})
251+
event := h.Backend().NewChannelEvent(channel, courier.EventDeleteContact, urn, clog).WithOccurredOn(date).WithExtra(map[string]string{"userID": payload.UserID})
252252

253253
err = h.Backend().WriteChannelEvent(ctx, event, clog)
254254
if err != nil {

0 commit comments

Comments
 (0)