diff options
Diffstat (limited to 'testrig')
| -rw-r--r-- | testrig/processor.go | 3 | ||||
| -rw-r--r-- | testrig/teststructs.go | 4 | ||||
| -rw-r--r-- | testrig/webpush.go | 14 |
3 files changed, 12 insertions, 9 deletions
diff --git a/testrig/processor.go b/testrig/processor.go index d2405a6f0..4acb7c648 100644 --- a/testrig/processor.go +++ b/testrig/processor.go @@ -22,6 +22,7 @@ import ( "code.superseriousbusiness.org/gotosocial/internal/email" "code.superseriousbusiness.org/gotosocial/internal/federation" "code.superseriousbusiness.org/gotosocial/internal/filter/interaction" + "code.superseriousbusiness.org/gotosocial/internal/filter/mutes" "code.superseriousbusiness.org/gotosocial/internal/filter/visibility" "code.superseriousbusiness.org/gotosocial/internal/media" "code.superseriousbusiness.org/gotosocial/internal/processing" @@ -41,7 +42,6 @@ func NewTestProcessor( webPushSender webpush.Sender, mediaManager *media.Manager, ) *processing.Processor { - return processing.NewProcessor( cleaner.New(state), subscriptions.New( @@ -57,6 +57,7 @@ func NewTestProcessor( emailSender, webPushSender, visibility.NewFilter(state), + mutes.NewFilter(state), interaction.NewFilter(state), ) } diff --git a/testrig/teststructs.go b/testrig/teststructs.go index 3ca45e94e..f119bd113 100644 --- a/testrig/teststructs.go +++ b/testrig/teststructs.go @@ -22,6 +22,7 @@ import ( "code.superseriousbusiness.org/gotosocial/internal/cleaner" "code.superseriousbusiness.org/gotosocial/internal/email" "code.superseriousbusiness.org/gotosocial/internal/filter/interaction" + "code.superseriousbusiness.org/gotosocial/internal/filter/mutes" "code.superseriousbusiness.org/gotosocial/internal/filter/visibility" "code.superseriousbusiness.org/gotosocial/internal/processing" "code.superseriousbusiness.org/gotosocial/internal/processing/common" @@ -67,6 +68,7 @@ func SetupTestStructs( state.Storage = storage typeconverter := typeutils.NewConverter(&state) visFilter := visibility.NewFilter(&state) + muteFilter := mutes.NewFilter(&state) intFilter := interaction.NewFilter(&state) httpClient := NewMockHTTPClient(nil, rMediaPath) @@ -86,6 +88,7 @@ func SetupTestStructs( typeconverter, federator, visFilter, + muteFilter, ) processor := processing.NewProcessor( @@ -99,6 +102,7 @@ func SetupTestStructs( emailSender, webPushSender, visFilter, + muteFilter, intFilter, ) diff --git a/testrig/webpush.go b/testrig/webpush.go index d4752ae90..b9ca9611d 100644 --- a/testrig/webpush.go +++ b/testrig/webpush.go @@ -20,7 +20,7 @@ package testrig import ( "context" - "code.superseriousbusiness.org/gotosocial/internal/filter/usermute" + apimodel "code.superseriousbusiness.org/gotosocial/internal/api/model" "code.superseriousbusiness.org/gotosocial/internal/gtsmodel" "code.superseriousbusiness.org/gotosocial/internal/webpush" ) @@ -39,11 +39,10 @@ func NewWebPushMockSender() *WebPushMockSender { func (m *WebPushMockSender) Send( ctx context.Context, - notification *gtsmodel.Notification, - filters []*gtsmodel.Filter, - mutes *usermute.CompiledUserMuteList, + notif *gtsmodel.Notification, + apiNotif *apimodel.Notification, ) error { - m.Sent[notification.TargetAccountID] = append(m.Sent[notification.TargetAccountID], notification) + m.Sent[notif.TargetAccountID] = append(m.Sent[notif.TargetAccountID], notif) return nil } @@ -57,9 +56,8 @@ func NewNoopWebPushSender() webpush.Sender { func (n *noopWebPushSender) Send( ctx context.Context, - notification *gtsmodel.Notification, - filters []*gtsmodel.Filter, - mutes *usermute.CompiledUserMuteList, + notif *gtsmodel.Notification, + apiNotif *apimodel.Notification, ) error { return nil } |
