mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2026-01-04 04:03:17 -06:00
add email sender to processor
This commit is contained in:
parent
2ca332250b
commit
5f6a0cd8cf
25 changed files with 139 additions and 220 deletions
|
|
@ -25,6 +25,7 @@ import (
|
|||
apimodel "github.com/superseriousbusiness/gotosocial/internal/api/model"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/config"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/db"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/email"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/federation"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/gtserror"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/gtsmodel"
|
||||
|
|
@ -86,10 +87,11 @@ type processor struct {
|
|||
formatter text.Formatter
|
||||
db db.DB
|
||||
federator federation.Federator
|
||||
emailSender email.Sender
|
||||
}
|
||||
|
||||
// New returns a new account processor.
|
||||
func New(db db.DB, tc typeutils.TypeConverter, mediaHandler media.Handler, oauthServer oauth.Server, fromClientAPI chan messages.FromClientAPI, federator federation.Federator, config *config.Config) Processor {
|
||||
func New(db db.DB, tc typeutils.TypeConverter, mediaHandler media.Handler, oauthServer oauth.Server, fromClientAPI chan messages.FromClientAPI, federator federation.Federator, emailSender email.Sender, config *config.Config) Processor {
|
||||
return &processor{
|
||||
tc: tc,
|
||||
config: config,
|
||||
|
|
@ -100,5 +102,6 @@ func New(db db.DB, tc typeutils.TypeConverter, mediaHandler media.Handler, oauth
|
|||
formatter: text.NewFormatter(config, db),
|
||||
db: db,
|
||||
federator: federator,
|
||||
emailSender: emailSender,
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ import (
|
|||
"github.com/stretchr/testify/suite"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/config"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/db"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/email"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/federation"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/gtsmodel"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/media"
|
||||
|
|
@ -48,6 +49,7 @@ type AccountStandardTestSuite struct {
|
|||
httpClient pub.HttpClient
|
||||
transportController transport.Controller
|
||||
federator federation.Federator
|
||||
emailSender email.Sender
|
||||
|
||||
// standard suite models
|
||||
testTokens map[string]*gtsmodel.Token
|
||||
|
|
@ -84,7 +86,8 @@ func (suite *AccountStandardTestSuite) SetupTest() {
|
|||
suite.httpClient = testrig.NewMockHTTPClient(nil)
|
||||
suite.transportController = testrig.NewTestTransportController(suite.httpClient, suite.db)
|
||||
suite.federator = testrig.NewTestFederator(suite.db, suite.transportController, suite.storage)
|
||||
suite.accountProcessor = account.New(suite.db, suite.tc, suite.mediaHandler, suite.oauthServer, suite.fromClientAPIChan, suite.federator, suite.config)
|
||||
suite.emailSender = testrig.NewEmailSender("../../../web/template/")
|
||||
suite.accountProcessor = account.New(suite.db, suite.tc, suite.mediaHandler, suite.oauthServer, suite.fromClientAPIChan, suite.federator, suite.emailSender, suite.config)
|
||||
testrig.StandardDBSetup(suite.db, nil)
|
||||
testrig.StandardStorageSetup(suite.storage, "../../../testrig/media")
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue