fix import cycle

This commit is contained in:
kim 2025-01-27 14:38:15 +00:00
commit 611f5f790e
2 changed files with 23 additions and 5 deletions

View file

@ -30,7 +30,9 @@ import (
// Sender can send Web Push notifications.
type Sender interface {
// Send queues up a notification for delivery to all of an account's Web Push subscriptions.
// Send queues up a notification for delivery to
// all of an account's Web Push subscriptions.
Send(
ctx context.Context,
notification *gtsmodel.Notification,
@ -55,3 +57,12 @@ func NewSender(httpClient *httpclient.Client, state *state.State, converter *typ
converter: converter,
}
}
// an internal function purely existing for the webpush test package to link to and use a custom http.Client{}.
func newSenderWith(client *http.Client, state *state.State, converter *typeutils.Converter) Sender {
return &realSender{
httpClient: client,
state: state,
converter: converter,
}
}