mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2026-01-05 05:53:16 -06:00
rename actions package
This commit is contained in:
parent
e773bba875
commit
175107f6a3
55 changed files with 116 additions and 116 deletions
|
|
@ -22,7 +22,7 @@ import (
|
|||
"time"
|
||||
|
||||
"github.com/stretchr/testify/suite"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/actions"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/admin"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/db"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/email"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/federation"
|
||||
|
|
@ -94,7 +94,7 @@ func (suite *AccountStandardTestSuite) SetupTest() {
|
|||
|
||||
suite.db = testrig.NewTestDB(&suite.state)
|
||||
suite.state.DB = suite.db
|
||||
suite.state.Actions = actions.New(suite.state.DB, &suite.state.Workers)
|
||||
suite.state.AdminActions = admin.New(suite.state.DB, &suite.state.Workers)
|
||||
suite.tc = typeutils.NewConverter(&suite.state)
|
||||
|
||||
testrig.StartTimelines(
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ func (suite *AccountTestSuite) TestAccountActionSuspend() {
|
|||
|
||||
// Wait for action to finish.
|
||||
if !testrig.WaitFor(func() bool {
|
||||
return suite.state.Actions.TotalRunning() == 0
|
||||
return suite.state.AdminActions.TotalRunning() == 0
|
||||
}) {
|
||||
suite.FailNow("timed out waiting for admin action(s) to finish")
|
||||
}
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ func (p *Processor) accountActionSuspend(
|
|||
) (string, gtserror.WithCode) {
|
||||
actionID := id.NewULID()
|
||||
|
||||
errWithCode := p.state.Actions.Run(
|
||||
errWithCode := p.state.AdminActions.Run(
|
||||
ctx,
|
||||
>smodel.AdminAction{
|
||||
ID: actionID,
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ package admin_test
|
|||
|
||||
import (
|
||||
"github.com/stretchr/testify/suite"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/actions"
|
||||
adminactions "github.com/superseriousbusiness/gotosocial/internal/admin"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/cleaner"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/db"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/email"
|
||||
|
|
@ -91,7 +91,7 @@ func (suite *AdminStandardTestSuite) SetupTest() {
|
|||
|
||||
suite.db = testrig.NewTestDB(&suite.state)
|
||||
suite.state.DB = suite.db
|
||||
suite.state.Actions = actions.New(suite.state.DB, &suite.state.Workers)
|
||||
suite.state.AdminActions = adminactions.New(suite.state.DB, &suite.state.Workers)
|
||||
suite.tc = typeutils.NewConverter(&suite.state)
|
||||
|
||||
testrig.StartTimelines(
|
||||
|
|
|
|||
|
|
@ -76,10 +76,10 @@ func (p *Processor) createDomainAllow(
|
|||
AccountID: adminAcct.ID,
|
||||
}
|
||||
|
||||
if errWithCode := p.state.Actions.Run(
|
||||
if errWithCode := p.state.AdminActions.Run(
|
||||
ctx,
|
||||
action,
|
||||
p.state.Actions.DomainAllowF(action.ID, domainAllow),
|
||||
p.state.AdminActions.DomainAllowF(action.ID, domainAllow),
|
||||
); errWithCode != nil {
|
||||
return nil, action.ID, errWithCode
|
||||
}
|
||||
|
|
@ -132,10 +132,10 @@ func (p *Processor) deleteDomainAllow(
|
|||
AccountID: adminAcct.ID,
|
||||
}
|
||||
|
||||
if errWithCode := p.state.Actions.Run(
|
||||
if errWithCode := p.state.AdminActions.Run(
|
||||
ctx,
|
||||
action,
|
||||
p.state.Actions.DomainUnallowF(action.ID, domainAllow),
|
||||
p.state.AdminActions.DomainUnallowF(action.ID, domainAllow),
|
||||
); errWithCode != nil {
|
||||
return nil, action.ID, errWithCode
|
||||
}
|
||||
|
|
|
|||
|
|
@ -77,10 +77,10 @@ func (p *Processor) createDomainBlock(
|
|||
Text: domainBlock.PrivateComment,
|
||||
}
|
||||
|
||||
if errWithCode := p.state.Actions.Run(
|
||||
if errWithCode := p.state.AdminActions.Run(
|
||||
ctx,
|
||||
action,
|
||||
p.state.Actions.DomainBlockF(action.ID, domainBlock),
|
||||
p.state.AdminActions.DomainBlockF(action.ID, domainBlock),
|
||||
); errWithCode != nil {
|
||||
return nil, action.ID, errWithCode
|
||||
}
|
||||
|
|
@ -133,10 +133,10 @@ func (p *Processor) deleteDomainBlock(
|
|||
AccountID: adminAcct.ID,
|
||||
}
|
||||
|
||||
if errWithCode := p.state.Actions.Run(
|
||||
if errWithCode := p.state.AdminActions.Run(
|
||||
ctx,
|
||||
action,
|
||||
p.state.Actions.DomainUnblockF(action.ID, domainBlock),
|
||||
p.state.AdminActions.DomainUnblockF(action.ID, domainBlock),
|
||||
); errWithCode != nil {
|
||||
return nil, action.ID, errWithCode
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,10 +48,10 @@ func (p *Processor) DomainKeysExpire(
|
|||
AccountID: adminAcct.ID,
|
||||
}
|
||||
|
||||
if errWithCode := p.state.Actions.Run(
|
||||
if errWithCode := p.state.AdminActions.Run(
|
||||
ctx,
|
||||
action,
|
||||
p.state.Actions.DomainKeysExpireF(domain),
|
||||
p.state.AdminActions.DomainKeysExpireF(domain),
|
||||
); errWithCode != nil {
|
||||
return action.ID, errWithCode
|
||||
}
|
||||
|
|
|
|||
|
|
@ -186,7 +186,7 @@ func (suite *DomainBlockTestSuite) awaitAction(actionID string) {
|
|||
ctx := context.Background()
|
||||
|
||||
if !testrig.WaitFor(func() bool {
|
||||
return suite.state.Actions.TotalRunning() == 0
|
||||
return suite.state.AdminActions.TotalRunning() == 0
|
||||
}) {
|
||||
suite.FailNow("timed out waiting for admin action(s) to finish")
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ import (
|
|||
"time"
|
||||
|
||||
"github.com/stretchr/testify/suite"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/actions"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/admin"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/db"
|
||||
dbtest "github.com/superseriousbusiness/gotosocial/internal/db/test"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/email"
|
||||
|
|
@ -104,7 +104,7 @@ func (suite *ConversationsTestSuite) SetupTest() {
|
|||
|
||||
suite.db = testrig.NewTestDB(&suite.state)
|
||||
suite.state.DB = suite.db
|
||||
suite.state.Actions = actions.New(suite.state.DB, &suite.state.Workers)
|
||||
suite.state.AdminActions = admin.New(suite.state.DB, &suite.state.Workers)
|
||||
suite.tc = typeutils.NewConverter(&suite.state)
|
||||
suite.filter = visibility.NewFilter(&suite.state)
|
||||
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ package media_test
|
|||
|
||||
import (
|
||||
"github.com/stretchr/testify/suite"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/actions"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/admin"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/db"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/filter/visibility"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/gtsmodel"
|
||||
|
|
@ -76,7 +76,7 @@ func (suite *MediaStandardTestSuite) SetupTest() {
|
|||
|
||||
suite.db = testrig.NewTestDB(&suite.state)
|
||||
suite.state.DB = suite.db
|
||||
suite.state.Actions = actions.New(suite.state.DB, &suite.state.Workers)
|
||||
suite.state.AdminActions = admin.New(suite.state.DB, &suite.state.Workers)
|
||||
suite.tc = typeutils.NewConverter(&suite.state)
|
||||
suite.storage = testrig.NewInMemoryStorage()
|
||||
suite.state.Storage = suite.storage
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ import (
|
|||
"context"
|
||||
|
||||
"github.com/stretchr/testify/suite"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/actions"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/admin"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/cleaner"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/db"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/email"
|
||||
|
|
@ -104,7 +104,7 @@ func (suite *ProcessingStandardTestSuite) SetupTest() {
|
|||
|
||||
suite.db = testrig.NewTestDB(&suite.state)
|
||||
suite.state.DB = suite.db
|
||||
suite.state.Actions = actions.New(suite.state.DB, &suite.state.Workers)
|
||||
suite.state.AdminActions = admin.New(suite.state.DB, &suite.state.Workers)
|
||||
suite.testActivities = testrig.NewTestActivities(suite.testAccounts)
|
||||
suite.storage = testrig.NewInMemoryStorage()
|
||||
suite.state.Storage = suite.storage
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ package status_test
|
|||
|
||||
import (
|
||||
"github.com/stretchr/testify/suite"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/actions"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/admin"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/db"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/federation"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/filter/interaction"
|
||||
|
|
@ -85,7 +85,7 @@ func (suite *StatusStandardTestSuite) SetupTest() {
|
|||
suite.db = testrig.NewTestDB(&suite.state)
|
||||
suite.typeConverter = typeutils.NewConverter(&suite.state)
|
||||
suite.state.DB = suite.db
|
||||
suite.state.Actions = actions.New(suite.state.DB, &suite.state.Workers)
|
||||
suite.state.AdminActions = admin.New(suite.state.DB, &suite.state.Workers)
|
||||
|
||||
suite.tc = testrig.NewTestTransportController(&suite.state, testrig.NewMockHTTPClient(nil, "../../../testrig/media"))
|
||||
suite.storage = testrig.NewInMemoryStorage()
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ package stream_test
|
|||
|
||||
import (
|
||||
"github.com/stretchr/testify/suite"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/actions"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/admin"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/db"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/gtsmodel"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/oauth"
|
||||
|
|
@ -51,7 +51,7 @@ func (suite *StreamTestSuite) SetupTest() {
|
|||
suite.testTokens = testrig.NewTestTokens()
|
||||
suite.db = testrig.NewTestDB(&suite.state)
|
||||
suite.state.DB = suite.db
|
||||
suite.state.Actions = actions.New(suite.state.DB, &suite.state.Workers)
|
||||
suite.state.AdminActions = admin.New(suite.state.DB, &suite.state.Workers)
|
||||
suite.oauthServer = testrig.NewTestOauthServer(suite.db)
|
||||
suite.streamProcessor = stream.New(&suite.state, suite.oauthServer)
|
||||
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ package timeline_test
|
|||
|
||||
import (
|
||||
"github.com/stretchr/testify/suite"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/actions"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/admin"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/db"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/filter/visibility"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/gtsmodel"
|
||||
|
|
@ -56,7 +56,7 @@ func (suite *TimelineStandardTestSuite) SetupTest() {
|
|||
|
||||
suite.db = testrig.NewTestDB(&suite.state)
|
||||
suite.state.DB = suite.db
|
||||
suite.state.Actions = actions.New(suite.state.DB, &suite.state.Workers)
|
||||
suite.state.AdminActions = admin.New(suite.state.DB, &suite.state.Workers)
|
||||
|
||||
suite.timeline = timeline.New(
|
||||
&suite.state,
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ package user_test
|
|||
|
||||
import (
|
||||
"github.com/stretchr/testify/suite"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/actions"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/admin"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/db"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/email"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/gtsmodel"
|
||||
|
|
@ -50,7 +50,7 @@ func (suite *UserStandardTestSuite) SetupTest() {
|
|||
|
||||
suite.db = testrig.NewTestDB(&suite.state)
|
||||
suite.state.DB = suite.db
|
||||
suite.state.Actions = actions.New(suite.state.DB, &suite.state.Workers)
|
||||
suite.state.AdminActions = admin.New(suite.state.DB, &suite.state.Workers)
|
||||
|
||||
suite.sentEmails = make(map[string]string)
|
||||
suite.emailSender = testrig.NewEmailSender("../../../web/template/", suite.sentEmails)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue