Skip to content

Commit

Permalink
chore: change name to handleSubscribedEventForPushNotification
Browse files Browse the repository at this point in the history
  • Loading branch information
im-adithya committed Dec 19, 2024
1 parent c2c9ca3 commit d71df15
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion internal/nostr/nostr.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ func NewService(ctx context.Context) (*Service, error) {
subscription := sub
handleEvent := svc.handleSubscribedEvent
if sub.PushToken != "" {
handleEvent = svc.handlePushNotification
handleEvent = svc.handleSubscribedEventForPushNotification
}
go svc.startSubscription(svc.Ctx, &subscription, nil, handleEvent)
}
Expand Down
4 changes: 2 additions & 2 deletions internal/nostr/push.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ func (svc *Service) NIP47PushNotificationHandler(c echo.Context) error {
})
}

go svc.startSubscription(svc.Ctx, &subscription, nil, svc.handlePushNotification)
go svc.startSubscription(svc.Ctx, &subscription, nil, svc.handleSubscribedEventForPushNotification)

return c.JSON(http.StatusOK, PushSubscriptionResponse{
SubscriptionId: subscription.Uuid,
Expand All @@ -117,7 +117,7 @@ func (svc *Service) NIP47PushNotificationHandler(c echo.Context) error {
})
}

func (svc *Service) handlePushNotification(event *nostr.Event, subscription *Subscription) {
func (svc *Service) handleSubscribedEventForPushNotification(event *nostr.Event, subscription *Subscription) {
svc.Logger.WithFields(logrus.Fields{
"event_id": event.ID,
"event_kind": event.Kind,
Expand Down

0 comments on commit d71df15

Please sign in to comment.