summaryrefslogtreecommitdiff
path: root/internal/api
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2023-02-22 16:05:26 +0100
committerLibravatar GitHub <noreply@github.com>2023-02-22 16:05:26 +0100
commitb6fbdc66c1ce1ec61ebfb6fcc0351ea627a1d288 (patch)
treec79d1107375597ab8a79045c80dd62dc95a204e7 /internal/api
parent[bugfix] Remove initial storage cleanup (#1545) (diff)
downloadgotosocial-b6fbdc66c1ce1ec61ebfb6fcc0351ea627a1d288.tar.xz
[chore] Deinterface processor and subprocessors (#1501)
* [chore] Deinterface processor and subprocessors * expose subprocessors via function calls * missing license header
Diffstat (limited to 'internal/api')
-rw-r--r--internal/api/activitypub.go2
-rw-r--r--internal/api/activitypub/emoji/emoji.go4
-rw-r--r--internal/api/activitypub/emoji/emojiget.go2
-rw-r--r--internal/api/activitypub/emoji/emojiget_test.go2
-rw-r--r--internal/api/activitypub/publickey/publickey.go4
-rw-r--r--internal/api/activitypub/publickey/publickeyget.go2
-rw-r--r--internal/api/activitypub/users/followers.go2
-rw-r--r--internal/api/activitypub/users/following.go2
-rw-r--r--internal/api/activitypub/users/inboxpost.go2
-rw-r--r--internal/api/activitypub/users/outboxget.go2
-rw-r--r--internal/api/activitypub/users/repliesget.go2
-rw-r--r--internal/api/activitypub/users/statusget.go2
-rw-r--r--internal/api/activitypub/users/user.go4
-rw-r--r--internal/api/activitypub/users/user_test.go2
-rw-r--r--internal/api/activitypub/users/userget.go2
-rw-r--r--internal/api/activitypub/users/userget_test.go9
-rw-r--r--internal/api/auth.go2
-rw-r--r--internal/api/auth/auth.go4
-rw-r--r--internal/api/auth/auth_test.go2
-rw-r--r--internal/api/client.go4
-rw-r--r--internal/api/client/accounts/account_test.go2
-rw-r--r--internal/api/client/accounts/accountcreate.go2
-rw-r--r--internal/api/client/accounts/accountdelete.go2
-rw-r--r--internal/api/client/accounts/accountget.go2
-rw-r--r--internal/api/client/accounts/accounts.go4
-rw-r--r--internal/api/client/accounts/accountupdate.go2
-rw-r--r--internal/api/client/accounts/accountverify.go2
-rw-r--r--internal/api/client/accounts/block.go2
-rw-r--r--internal/api/client/accounts/follow.go2
-rw-r--r--internal/api/client/accounts/followers.go2
-rw-r--r--internal/api/client/accounts/following.go2
-rw-r--r--internal/api/client/accounts/relationships.go2
-rw-r--r--internal/api/client/accounts/statuses.go2
-rw-r--r--internal/api/client/accounts/unblock.go2
-rw-r--r--internal/api/client/accounts/unfollow.go2
-rw-r--r--internal/api/client/admin/accountaction.go2
-rw-r--r--internal/api/client/admin/admin.go4
-rw-r--r--internal/api/client/admin/admin_test.go2
-rw-r--r--internal/api/client/admin/domainblockcreate.go4
-rw-r--r--internal/api/client/admin/domainblockdelete.go2
-rw-r--r--internal/api/client/admin/domainblockget.go2
-rw-r--r--internal/api/client/admin/domainblocksget.go2
-rw-r--r--internal/api/client/admin/emojicategoriesget.go2
-rw-r--r--internal/api/client/admin/emojicreate.go2
-rw-r--r--internal/api/client/admin/emojidelete.go2
-rw-r--r--internal/api/client/admin/emojiget.go2
-rw-r--r--internal/api/client/admin/emojisget.go2
-rw-r--r--internal/api/client/admin/emojiupdate.go2
-rw-r--r--internal/api/client/admin/mediacleanup.go2
-rw-r--r--internal/api/client/admin/mediarefetch.go2
-rw-r--r--internal/api/client/admin/reportget.go2
-rw-r--r--internal/api/client/admin/reportresolve.go2
-rw-r--r--internal/api/client/admin/reportsget.go2
-rw-r--r--internal/api/client/apps/apps.go4
-rw-r--r--internal/api/client/blocks/blocks.go4
-rw-r--r--internal/api/client/bookmarks/bookmarks.go4
-rw-r--r--internal/api/client/bookmarks/bookmarks_test.go2
-rw-r--r--internal/api/client/bookmarks/bookmarksget.go2
-rw-r--r--internal/api/client/customemojis/customemojis.go4
-rw-r--r--internal/api/client/customemojis/customemojisget.go2
-rw-r--r--internal/api/client/favourites/favourites.go4
-rw-r--r--internal/api/client/favourites/favourites_test.go2
-rw-r--r--internal/api/client/featuredtags/featuredtags.go4
-rw-r--r--internal/api/client/filters/filter.go4
-rw-r--r--internal/api/client/followrequests/followrequest.go4
-rw-r--r--internal/api/client/followrequests/followrequest_test.go2
-rw-r--r--internal/api/client/instance/instance.go4
-rw-r--r--internal/api/client/instance/instance_test.go2
-rw-r--r--internal/api/client/lists/list.go4
-rw-r--r--internal/api/client/media/media.go4
-rw-r--r--internal/api/client/media/mediacreate.go2
-rw-r--r--internal/api/client/media/mediacreate_test.go2
-rw-r--r--internal/api/client/media/mediaget.go2
-rw-r--r--internal/api/client/media/mediaupdate.go2
-rw-r--r--internal/api/client/media/mediaupdate_test.go2
-rw-r--r--internal/api/client/notifications/notifications.go4
-rw-r--r--internal/api/client/reports/reportcreate.go2
-rw-r--r--internal/api/client/reports/reportget.go2
-rw-r--r--internal/api/client/reports/reports.go4
-rw-r--r--internal/api/client/reports/reports_test.go2
-rw-r--r--internal/api/client/reports/reportsget.go2
-rw-r--r--internal/api/client/search/search.go4
-rw-r--r--internal/api/client/search/search_test.go2
-rw-r--r--internal/api/client/statuses/status.go4
-rw-r--r--internal/api/client/statuses/status_test.go2
-rw-r--r--internal/api/client/statuses/statusbookmark.go2
-rw-r--r--internal/api/client/statuses/statusboost.go2
-rw-r--r--internal/api/client/statuses/statusboostedby.go2
-rw-r--r--internal/api/client/statuses/statuscontext.go2
-rw-r--r--internal/api/client/statuses/statuscreate.go2
-rw-r--r--internal/api/client/statuses/statusdelete.go2
-rw-r--r--internal/api/client/statuses/statusfave.go2
-rw-r--r--internal/api/client/statuses/statusfavedby.go2
-rw-r--r--internal/api/client/statuses/statusget.go2
-rw-r--r--internal/api/client/statuses/statusunbookmark.go2
-rw-r--r--internal/api/client/statuses/statusunboost.go2
-rw-r--r--internal/api/client/statuses/statusunfave.go2
-rw-r--r--internal/api/client/streaming/stream.go4
-rw-r--r--internal/api/client/streaming/streaming.go4
-rw-r--r--internal/api/client/streaming/streaming_test.go2
-rw-r--r--internal/api/client/timelines/timeline.go4
-rw-r--r--internal/api/client/user/passwordchange.go2
-rw-r--r--internal/api/client/user/user.go4
-rw-r--r--internal/api/client/user/user_test.go2
-rw-r--r--internal/api/fileserver.go2
-rw-r--r--internal/api/fileserver/fileserver.go4
-rw-r--r--internal/api/fileserver/fileserver_test.go2
-rw-r--r--internal/api/fileserver/servefile.go2
-rw-r--r--internal/api/nodeinfo.go2
-rw-r--r--internal/api/nodeinfo/nodeinfo.go4
-rw-r--r--internal/api/nodeinfo/nodeinfoget.go2
-rw-r--r--internal/api/wellknown.go2
-rw-r--r--internal/api/wellknown/nodeinfo/nodeinfo.go4
-rw-r--r--internal/api/wellknown/nodeinfo/nodeinfoget.go2
-rw-r--r--internal/api/wellknown/webfinger/webfinger.go4
-rw-r--r--internal/api/wellknown/webfinger/webfinger_test.go2
-rw-r--r--internal/api/wellknown/webfinger/webfingerget.go2
117 files changed, 148 insertions, 155 deletions
diff --git a/internal/api/activitypub.go b/internal/api/activitypub.go
index 72a8f6e26..a1081b6ab 100644
--- a/internal/api/activitypub.go
+++ b/internal/api/activitypub.go
@@ -59,7 +59,7 @@ func (a *ActivityPub) RoutePublicKey(r router.Router, m ...gin.HandlerFunc) {
a.publicKey.Route(publicKeyGroup.Handle)
}
-func NewActivityPub(db db.DB, p processing.Processor) *ActivityPub {
+func NewActivityPub(db db.DB, p *processing.Processor) *ActivityPub {
return &ActivityPub{
emoji: emoji.New(p),
users: users.New(p),
diff --git a/internal/api/activitypub/emoji/emoji.go b/internal/api/activitypub/emoji/emoji.go
index b9b3f7eb9..0efd4bf88 100644
--- a/internal/api/activitypub/emoji/emoji.go
+++ b/internal/api/activitypub/emoji/emoji.go
@@ -33,10 +33,10 @@ const (
)
type Module struct {
- processor processing.Processor
+ processor *processing.Processor
}
-func New(processor processing.Processor) *Module {
+func New(processor *processing.Processor) *Module {
return &Module{
processor: processor,
}
diff --git a/internal/api/activitypub/emoji/emojiget.go b/internal/api/activitypub/emoji/emojiget.go
index e9e9eff11..e66a854c7 100644
--- a/internal/api/activitypub/emoji/emojiget.go
+++ b/internal/api/activitypub/emoji/emojiget.go
@@ -43,7 +43,7 @@ func (m *Module) EmojiGetHandler(c *gin.Context) {
return
}
- resp, errWithCode := m.processor.GetFediEmoji(apiutil.TransferSignatureContext(c), requestedEmojiID, c.Request.URL)
+ resp, errWithCode := m.processor.Fedi().EmojiGet(apiutil.TransferSignatureContext(c), requestedEmojiID, c.Request.URL)
if errWithCode != nil {
apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGetV1)
return
diff --git a/internal/api/activitypub/emoji/emojiget_test.go b/internal/api/activitypub/emoji/emojiget_test.go
index 3e05a5737..cd7333955 100644
--- a/internal/api/activitypub/emoji/emojiget_test.go
+++ b/internal/api/activitypub/emoji/emojiget_test.go
@@ -48,7 +48,7 @@ type EmojiGetTestSuite struct {
mediaManager media.Manager
federator federation.Federator
emailSender email.Sender
- processor processing.Processor
+ processor *processing.Processor
storage *storage.Driver
testEmojis map[string]*gtsmodel.Emoji
diff --git a/internal/api/activitypub/publickey/publickey.go b/internal/api/activitypub/publickey/publickey.go
index 7b3882628..39712cf88 100644
--- a/internal/api/activitypub/publickey/publickey.go
+++ b/internal/api/activitypub/publickey/publickey.go
@@ -34,10 +34,10 @@ const (
)
type Module struct {
- processor processing.Processor
+ processor *processing.Processor
}
-func New(processor processing.Processor) *Module {
+func New(processor *processing.Processor) *Module {
return &Module{
processor: processor,
}
diff --git a/internal/api/activitypub/publickey/publickeyget.go b/internal/api/activitypub/publickey/publickeyget.go
index 36e1c3569..8cc0d346f 100644
--- a/internal/api/activitypub/publickey/publickeyget.go
+++ b/internal/api/activitypub/publickey/publickeyget.go
@@ -55,7 +55,7 @@ func (m *Module) PublicKeyGETHandler(c *gin.Context) {
return
}
- resp, errWithCode := m.processor.GetFediUser(apiutil.TransferSignatureContext(c), requestedUsername, c.Request.URL)
+ resp, errWithCode := m.processor.Fedi().UserGet(apiutil.TransferSignatureContext(c), requestedUsername, c.Request.URL)
if errWithCode != nil {
apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGetV1)
return
diff --git a/internal/api/activitypub/users/followers.go b/internal/api/activitypub/users/followers.go
index 040e1cff7..649e20e45 100644
--- a/internal/api/activitypub/users/followers.go
+++ b/internal/api/activitypub/users/followers.go
@@ -51,7 +51,7 @@ func (m *Module) FollowersGETHandler(c *gin.Context) {
return
}
- resp, errWithCode := m.processor.GetFediFollowers(apiutil.TransferSignatureContext(c), requestedUsername, c.Request.URL)
+ resp, errWithCode := m.processor.Fedi().FollowersGet(apiutil.TransferSignatureContext(c), requestedUsername, c.Request.URL)
if errWithCode != nil {
apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGetV1)
return
diff --git a/internal/api/activitypub/users/following.go b/internal/api/activitypub/users/following.go
index 629df2503..1a6e99a53 100644
--- a/internal/api/activitypub/users/following.go
+++ b/internal/api/activitypub/users/following.go
@@ -51,7 +51,7 @@ func (m *Module) FollowingGETHandler(c *gin.Context) {
return
}
- resp, errWithCode := m.processor.GetFediFollowing(apiutil.TransferSignatureContext(c), requestedUsername, c.Request.URL)
+ resp, errWithCode := m.processor.Fedi().FollowingGet(apiutil.TransferSignatureContext(c), requestedUsername, c.Request.URL)
if errWithCode != nil {
apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGetV1)
return
diff --git a/internal/api/activitypub/users/inboxpost.go b/internal/api/activitypub/users/inboxpost.go
index 0815394b7..b70516905 100644
--- a/internal/api/activitypub/users/inboxpost.go
+++ b/internal/api/activitypub/users/inboxpost.go
@@ -38,7 +38,7 @@ func (m *Module) InboxPOSTHandler(c *gin.Context) {
return
}
- if posted, err := m.processor.InboxPost(apiutil.TransferSignatureContext(c), c.Writer, c.Request); err != nil {
+ if posted, err := m.processor.Fedi().InboxPost(apiutil.TransferSignatureContext(c), c.Writer, c.Request); err != nil {
if withCode, ok := err.(gtserror.WithCode); ok {
apiutil.ErrorHandler(c, withCode, m.processor.InstanceGetV1)
} else {
diff --git a/internal/api/activitypub/users/outboxget.go b/internal/api/activitypub/users/outboxget.go
index ad9a3829f..c081e4f92 100644
--- a/internal/api/activitypub/users/outboxget.go
+++ b/internal/api/activitypub/users/outboxget.go
@@ -129,7 +129,7 @@ func (m *Module) OutboxGETHandler(c *gin.Context) {
maxID = maxIDString
}
- resp, errWithCode := m.processor.GetFediOutbox(apiutil.TransferSignatureContext(c), requestedUsername, page, maxID, minID, c.Request.URL)
+ resp, errWithCode := m.processor.Fedi().OutboxGet(apiutil.TransferSignatureContext(c), requestedUsername, page, maxID, minID, c.Request.URL)
if errWithCode != nil {
apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGetV1)
return
diff --git a/internal/api/activitypub/users/repliesget.go b/internal/api/activitypub/users/repliesget.go
index 7e3d459db..2c17a99d1 100644
--- a/internal/api/activitypub/users/repliesget.go
+++ b/internal/api/activitypub/users/repliesget.go
@@ -150,7 +150,7 @@ func (m *Module) StatusRepliesGETHandler(c *gin.Context) {
minID = minIDString
}
- resp, errWithCode := m.processor.GetFediStatusReplies(apiutil.TransferSignatureContext(c), requestedUsername, requestedStatusID, page, onlyOtherAccounts, minID, c.Request.URL)
+ resp, errWithCode := m.processor.Fedi().StatusRepliesGet(apiutil.TransferSignatureContext(c), requestedUsername, requestedStatusID, page, onlyOtherAccounts, minID, c.Request.URL)
if errWithCode != nil {
apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGetV1)
return
diff --git a/internal/api/activitypub/users/statusget.go b/internal/api/activitypub/users/statusget.go
index 766fee429..69d873efa 100644
--- a/internal/api/activitypub/users/statusget.go
+++ b/internal/api/activitypub/users/statusget.go
@@ -59,7 +59,7 @@ func (m *Module) StatusGETHandler(c *gin.Context) {
return
}
- resp, errWithCode := m.processor.GetFediStatus(apiutil.TransferSignatureContext(c), requestedUsername, requestedStatusID, c.Request.URL)
+ resp, errWithCode := m.processor.Fedi().StatusGet(apiutil.TransferSignatureContext(c), requestedUsername, requestedStatusID, c.Request.URL)
if errWithCode != nil {
apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGetV1)
return
diff --git a/internal/api/activitypub/users/user.go b/internal/api/activitypub/users/user.go
index 257453bcb..b31017866 100644
--- a/internal/api/activitypub/users/user.go
+++ b/internal/api/activitypub/users/user.go
@@ -57,10 +57,10 @@ const (
)
type Module struct {
- processor processing.Processor
+ processor *processing.Processor
}
-func New(processor processing.Processor) *Module {
+func New(processor *processing.Processor) *Module {
return &Module{
processor: processor,
}
diff --git a/internal/api/activitypub/users/user_test.go b/internal/api/activitypub/users/user_test.go
index 991844b78..0124925b9 100644
--- a/internal/api/activitypub/users/user_test.go
+++ b/internal/api/activitypub/users/user_test.go
@@ -44,7 +44,7 @@ type UserStandardTestSuite struct {
mediaManager media.Manager
federator federation.Federator
emailSender email.Sender
- processor processing.Processor
+ processor *processing.Processor
storage *storage.Driver
// standard suite models
diff --git a/internal/api/activitypub/users/userget.go b/internal/api/activitypub/users/userget.go
index 97f101cfc..5c8f689f3 100644
--- a/internal/api/activitypub/users/userget.go
+++ b/internal/api/activitypub/users/userget.go
@@ -59,7 +59,7 @@ func (m *Module) UsersGETHandler(c *gin.Context) {
return
}
- resp, errWithCode := m.processor.GetFediUser(apiutil.TransferSignatureContext(c), requestedUsername, c.Request.URL)
+ resp, errWithCode := m.processor.Fedi().UserGet(apiutil.TransferSignatureContext(c), requestedUsername, c.Request.URL)
if errWithCode != nil {
apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGetV1)
return
diff --git a/internal/api/activitypub/users/userget_test.go b/internal/api/activitypub/users/userget_test.go
index 60fa0c4db..a5467b99a 100644
--- a/internal/api/activitypub/users/userget_test.go
+++ b/internal/api/activitypub/users/userget_test.go
@@ -32,7 +32,6 @@ import (
"github.com/superseriousbusiness/activity/streams/vocab"
"github.com/superseriousbusiness/gotosocial/internal/api/activitypub/users"
apimodel "github.com/superseriousbusiness/gotosocial/internal/api/model"
- "github.com/superseriousbusiness/gotosocial/internal/oauth"
"github.com/superseriousbusiness/gotosocial/testrig"
)
@@ -100,13 +99,7 @@ func (suite *UserGetTestSuite) TestGetUserPublicKeyDeleted() {
userModule := users.New(suite.processor)
targetAccount := suite.testAccounts["local_account_1"]
- // first delete the account, as though zork had deleted himself
- authed := &oauth.Auth{
- Application: suite.testApplications["local_account_1"],
- User: suite.testUsers["local_account_1"],
- Account: suite.testAccounts["local_account_1"],
- }
- suite.processor.AccountDeleteLocal(context.Background(), authed, &apimodel.AccountDeleteRequest{
+ suite.processor.Account().DeleteLocal(context.Background(), suite.testAccounts["local_account_1"], &apimodel.AccountDeleteRequest{
Password: "password",
DeleteOriginID: targetAccount.ID,
})
diff --git a/internal/api/auth.go b/internal/api/auth.go
index 022185223..adde87636 100644
--- a/internal/api/auth.go
+++ b/internal/api/auth.go
@@ -56,7 +56,7 @@ func (a *Auth) Route(r router.Router, m ...gin.HandlerFunc) {
a.auth.RouteOauth(oauthGroup.Handle)
}
-func NewAuth(db db.DB, p processing.Processor, idp oidc.IDP, routerSession *gtsmodel.RouterSession, sessionName string) *Auth {
+func NewAuth(db db.DB, p *processing.Processor, idp oidc.IDP, routerSession *gtsmodel.RouterSession, sessionName string) *Auth {
return &Auth{
routerSession: routerSession,
sessionName: sessionName,
diff --git a/internal/api/auth/auth.go b/internal/api/auth/auth.go
index 4d025ed62..2d0814782 100644
--- a/internal/api/auth/auth.go
+++ b/internal/api/auth/auth.go
@@ -78,14 +78,14 @@ const (
type Module struct {
db db.DB
- processor processing.Processor
+ processor *processing.Processor
idp oidc.IDP
}
// New returns an Auth module which provides both 'oauth' and 'auth' endpoints.
//
// It is safe to pass a nil idp if oidc is disabled.
-func New(db db.DB, processor processing.Processor, idp oidc.IDP) *Module {
+func New(db db.DB, processor *processing.Processor, idp oidc.IDP) *Module {
return &Module{
db: db,
processor: processor,
diff --git a/internal/api/auth/auth_test.go b/internal/api/auth/auth_test.go
index 337d29a3c..a5e518cda 100644
--- a/internal/api/auth/auth_test.go
+++ b/internal/api/auth/auth_test.go
@@ -49,7 +49,7 @@ type AuthStandardTestSuite struct {
storage *storage.Driver
mediaManager media.Manager
federator federation.Federator
- processor processing.Processor
+ processor *processing.Processor
emailSender email.Sender
idp oidc.IDP
diff --git a/internal/api/client.go b/internal/api/client.go
index 2ce3cdc97..57f648634 100644
--- a/internal/api/client.go
+++ b/internal/api/client.go
@@ -49,7 +49,7 @@ import (
)
type Client struct {
- processor processing.Processor
+ processor *processing.Processor
db db.DB
accounts *accounts.Module // api/v1/accounts
@@ -110,7 +110,7 @@ func (c *Client) Route(r router.Router, m ...gin.HandlerFunc) {
c.user.Route(h)
}
-func NewClient(db db.DB, p processing.Processor) *Client {
+func NewClient(db db.DB, p *processing.Processor) *Client {
return &Client{
processor: p,
db: db,
diff --git a/internal/api/client/accounts/account_test.go b/internal/api/client/accounts/account_test.go
index 8a319e7fd..5a25c12f1 100644
--- a/internal/api/client/accounts/account_test.go
+++ b/internal/api/client/accounts/account_test.go
@@ -48,7 +48,7 @@ type AccountStandardTestSuite struct {
storage *storage.Driver
mediaManager media.Manager
federator federation.Federator
- processor processing.Processor
+ processor *processing.Processor
emailSender email.Sender
sentEmails map[string]string
diff --git a/internal/api/client/accounts/accountcreate.go b/internal/api/client/accounts/accountcreate.go
index 873d00beb..409105a2d 100644
--- a/internal/api/client/accounts/accountcreate.go
+++ b/internal/api/client/accounts/accountcreate.go
@@ -102,7 +102,7 @@ func (m *Module) AccountCreatePOSTHandler(c *gin.Context) {
}
form.IP = signUpIP
- ti, errWithCode := m.processor.AccountCreate(c.Request.Context(), authed, form)
+ ti, errWithCode := m.processor.Account().Create(c.Request.Context(), authed.Token, authed.Application, form)
if errWithCode != nil {
apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGetV1)
return
diff --git a/internal/api/client/accounts/accountdelete.go b/internal/api/client/accounts/accountdelete.go
index b0c5e48de..64ea5e548 100644
--- a/internal/api/client/accounts/accountdelete.go
+++ b/internal/api/client/accounts/accountdelete.go
@@ -86,7 +86,7 @@ func (m *Module) AccountDeletePOSTHandler(c *gin.Context) {
form.DeleteOriginID = authed.Account.ID
- if errWithCode := m.processor.AccountDeleteLocal(c.Request.Context(), authed, form); errWithCode != nil {
+ if errWithCode := m.processor.Account().DeleteLocal(c.Request.Context(), authed.Account, form); errWithCode != nil {
apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGetV1)
return
}
diff --git a/internal/api/client/accounts/accountget.go b/internal/api/client/accounts/accountget.go
index ca6b9c661..9fcbf7a4b 100644
--- a/internal/api/client/accounts/accountget.go
+++ b/internal/api/client/accounts/accountget.go
@@ -85,7 +85,7 @@ func (m *Module) AccountGETHandler(c *gin.Context) {
return
}
- acctInfo, errWithCode := m.processor.AccountGet(c.Request.Context(), authed, targetAcctID)
+ acctInfo, errWithCode := m.processor.Account().Get(c.Request.Context(), authed.Account, targetAcctID)
if errWithCode != nil {
apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGetV1)
return
diff --git a/internal/api/client/accounts/accounts.go b/internal/api/client/accounts/accounts.go
index 4006b607d..02f900df5 100644
--- a/internal/api/client/accounts/accounts.go
+++ b/internal/api/client/accounts/accounts.go
@@ -74,10 +74,10 @@ const (
)
type Module struct {
- processor processing.Processor
+ processor *processing.Processor
}
-func New(processor processing.Processor) *Module {
+func New(processor *processing.Processor) *Module {
return &Module{
processor: processor,
}
diff --git a/internal/api/client/accounts/accountupdate.go b/internal/api/client/accounts/accountupdate.go
index 65a950514..3983fe8e1 100644
--- a/internal/api/client/accounts/accountupdate.go
+++ b/internal/api/client/accounts/accountupdate.go
@@ -153,7 +153,7 @@ func (m *Module) AccountUpdateCredentialsPATCHHandler(c *gin.Context) {
return
}
- acctSensitive, errWithCode := m.processor.AccountUpdate(c.Request.Context(), authed, form)
+ acctSensitive, errWithCode := m.processor.Account().Update(c.Request.Context(), authed.Account, form)
if errWithCode != nil {
apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGetV1)
return
diff --git a/internal/api/client/accounts/accountverify.go b/internal/api/client/accounts/accountverify.go
index 868e095b8..59fc5b2b1 100644
--- a/internal/api/client/accounts/accountverify.go
+++ b/internal/api/client/accounts/accountverify.go
@@ -68,7 +68,7 @@ func (m *Module) AccountVerifyGETHandler(c *gin.Context) {
return
}
- acctSensitive, errWithCode := m.processor.AccountGet(c.Request.Context(), authed, authed.Account.ID)
+ acctSensitive, errWithCode := m.processor.Account().Get(c.Request.Context(), authed.Account, authed.Account.ID)
if errWithCode != nil {
apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGetV1)
return
diff --git a/internal/api/client/accounts/block.go b/internal/api/client/accounts/block.go
index cfa452a5e..2cd7b5448 100644
--- a/internal/api/client/accounts/block.go
+++ b/internal/api/client/accounts/block.go
@@ -85,7 +85,7 @@ func (m *Module) AccountBlockPOSTHandler(c *gin.Context) {
return
}
- relationship, errWithCode := m.processor.AccountBlockCreate(c.Request.Context(), authed, targetAcctID)
+ relationship, errWithCode := m.processor.Account().BlockCreate(c.Request.Context(), authed.Account, targetAcctID)
if errWithCode != nil {
apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGetV1)
return
diff --git a/internal/api/client/accounts/follow.go b/internal/api/client/accounts/follow.go
index 60e526ca1..d08f034e2 100644
--- a/internal/api/client/accounts/follow.go
+++ b/internal/api/client/accounts/follow.go
@@ -114,7 +114,7 @@ func (m *Module) AccountFollowPOSTHandler(c *gin.Context) {
}
form.ID = targetAcctID
- relationship, errWithCode := m.processor.AccountFollowCreate(c.Request.Context(), authed, form)
+ relationship, errWithCode := m.processor.Account().FollowCreate(c.Request.Context(), authed.Account, form)
if errWithCode != nil {
apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGetV1)
return
diff --git a/internal/api/client/accounts/followers.go b/internal/api/client/accounts/followers.go
index a9b188d7b..f6d16705c 100644
--- a/internal/api/client/accounts/followers.go
+++ b/internal/api/client/accounts/followers.go
@@ -88,7 +88,7 @@ func (m *Module) AccountFollowersGETHandler(c *gin.Context) {
return
}
- followers, errWithCode := m.processor.AccountFollowersGet(c.Request.Context(), authed, targetAcctID)
+ followers, errWithCode := m.processor.Account().FollowersGet(c.Request.Context(), authed.Account, targetAcctID)
if errWithCode != nil {
apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGetV1)
return
diff --git a/internal/api/client/accounts/following.go b/internal/api/client/accounts/following.go
index 9717816b0..eb46acb33 100644
--- a/internal/api/client/accounts/following.go
+++ b/internal/api/client/accounts/following.go
@@ -88,7 +88,7 @@ func (m *Module) AccountFollowingGETHandler(c *gin.Context) {
return
}
- following, errWithCode := m.processor.AccountFollowingGet(c.Request.Context(), authed, targetAcctID)
+ following, errWithCode := m.processor.Account().FollowingGet(c.Request.Context(), authed.Account, targetAcctID)
if errWithCode != nil {
apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGetV1)
return
diff --git a/internal/api/client/accounts/relationships.go b/internal/api/client/accounts/relationships.go
index 1d176cfe0..1f75399ee 100644
--- a/internal/api/client/accounts/relationships.go
+++ b/internal/api/client/accounts/relationships.go
@@ -81,7 +81,7 @@ func (m *Module) AccountRelationshipsGETHandler(c *gin.Context) {
relationships := []apimodel.Relationship{}
for _, targetAccountID := range targetAccountIDs {
- r, errWithCode := m.processor.AccountRelationshipGet(c.Request.Context(), authed, targetAccountID)
+ r, errWithCode := m.processor.Account().RelationshipGet(c.Request.Context(), authed.Account, targetAccountID)
if errWithCode != nil {
apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGetV1)
return
diff --git a/internal/api/client/accounts/statuses.go b/internal/api/client/accounts/statuses.go
index ba35d5c49..e5d5b0b23 100644
--- a/internal/api/client/accounts/statuses.go
+++ b/internal/api/client/accounts/statuses.go
@@ -233,7 +233,7 @@ func (m *Module) AccountStatusesGETHandler(c *gin.Context) {
publicOnly = i
}
- resp, errWithCode := m.processor.AccountStatusesGet(c.Request.Context(), authed, targetAcctID, limit, excludeReplies, excludeReblogs, maxID, minID, pinnedOnly, mediaOnly, publicOnly)
+ resp, errWithCode := m.processor.Account().StatusesGet(c.Request.Context(), authed.Account, targetAcctID, limit, excludeReplies, excludeReblogs, maxID, minID, pinnedOnly, mediaOnly, publicOnly)
if errWithCode != nil {
apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGetV1)
return
diff --git a/internal/api/client/accounts/unblock.go b/internal/api/client/accounts/unblock.go
index 50213ad80..c0003771c 100644
--- a/internal/api/client/accounts/unblock.go
+++ b/internal/api/client/accounts/unblock.go
@@ -86,7 +86,7 @@ func (m *Module) AccountUnblockPOSTHandler(c *gin.Context) {
return
}
- relationship, errWithCode := m.processor.AccountBlockRemove(c.Request.Context(), authed, targetAcctID)
+ relationship, errWithCode := m.processor.Account().BlockRemove(c.Request.Context(), authed.Account, targetAcctID)
if errWithCode != nil {
apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGetV1)
return
diff --git a/internal/api/client/accounts/unfollow.go b/internal/api/client/accounts/unfollow.go
index 77dab0b07..ab480cf4f 100644
--- a/internal/api/client/accounts/unfollow.go
+++ b/internal/api/client/accounts/unfollow.go
@@ -86,7 +86,7 @@ func (m *Module) AccountUnfollowPOSTHandler(c *gin.Context) {
return
}
- relationship, errWithCode := m.processor.AccountFollowRemove(c.Request.Context(), authed, targetAcctID)
+ relationship, errWithCode := m.processor.Account().FollowRemove(c.Request.Context(), authed.Account, targetAcctID)
if errWithCode != nil {
apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGetV1)
return
diff --git a/internal/api/client/admin/accountaction.go b/internal/api/client/admin/accountaction.go
index 32bb135d1..0b4a50330 100644
--- a/internal/api/client/admin/accountaction.go
+++ b/internal/api/client/admin/accountaction.go
@@ -115,7 +115,7 @@ func (m *Module) AccountActionPOSTHandler(c *gin.Context) {
}
form.TargetAccountID = targetAcctID
- if errWithCode := m.processor.AdminAccountAction(c.Request.Context(), authed, form); errWithCode != nil {
+ if errWithCode := m.processor.Admin().AccountAction(c.Request.Context(), authed.Account, form); errWithCode != nil {
apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGetV1)
return
}
diff --git a/internal/api/client/admin/admin.go b/internal/api/client/admin/admin.go
index f7e54d271..1b9ea302d 100644
--- a/internal/api/client/admin/admin.go
+++ b/internal/api/client/admin/admin.go
@@ -83,10 +83,10 @@ const (
)
type Module struct {
- processor processing.Processor
+ processor *processing.Processor
}
-func New(processor processing.Processor) *Module {
+func New(processor *processing.Processor) *Module {
return &Module{
processor: processor,
}
diff --git a/internal/api/client/admin/admin_test.go b/internal/api/client/admin/admin_test.go
index 000ca1927..4f3f48904 100644
--- a/internal/api/client/admin/admin_test.go
+++ b/internal/api/client/admin/admin_test.go
@@ -48,7 +48,7 @@ type AdminStandardTestSuite struct {
storage *storage.Driver
mediaManager media.Manager
federator federation.Federator
- processor processing.Processor
+ processor *processing.Processor
emailSender email.Sender
sentEmails map[string]string
diff --git a/internal/api/client/admin/domainblockcreate.go b/internal/api/client/admin/domainblockcreate.go
index b46d71f91..ab65dd62e 100644
--- a/internal/api/client/admin/domainblockcreate.go
+++ b/internal/api/client/admin/domainblockcreate.go
@@ -167,7 +167,7 @@ func (m *Module) DomainBlocksPOSTHandler(c *gin.Context) {
if imp {
// we're importing multiple blocks
- domainBlocks, errWithCode := m.processor.AdminDomainBlocksImport(c.Request.Context(), authed, form)
+ domainBlocks, errWithCode := m.processor.Admin().DomainBlocksImport(c.Request.Context(), authed.Account, form.Domains)
if errWithCode != nil {
apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGetV1)
return
@@ -177,7 +177,7 @@ func (m *Module) DomainBlocksPOSTHandler(c *gin.Context) {
}
// we're just creating one block
- domainBlock, errWithCode := m.processor.AdminDomainBlockCreate(c.Request.Context(), authed, form)
+ domainBlock, errWithCode := m.processor.Admin().DomainBlockCreate(c.Request.Context(), authed.Account, form.Domain, form.Obfuscate, form.PublicComment, form.PrivateComment, "")
if errWithCode != nil {
apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGetV1)
return
diff --git a/internal/api/client/admin/domainblockdelete.go b/internal/api/client/admin/domainblockdelete.go
index e360d11cd..89dfa93a5 100644
--- a/internal/api/client/admin/domainblockdelete.go
+++ b/internal/api/client/admin/domainblockdelete.go
@@ -94,7 +94,7 @@ func (m *Module) DomainBlockDELETEHandler(c *gin.Context) {
return
}
- domainBlock, errWithCode := m.processor.AdminDomainBlockDelete(c.Request.Context(), authed, domainBlockID)
+ domainBlock, errWithCode := m.processor.Admin().DomainBlockDelete(c.Request.Context(), authed.Account, domainBlockID)
if errWithCode != nil {
apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGetV1)
return
diff --git a/internal/api/client/admin/domainblockget.go b/internal/api/client/admin/domainblockget.go
index dd329fa48..aaf23684a 100644
--- a/internal/api/client/admin/domainblockget.go
+++ b/internal/api/client/admin/domainblockget.go
@@ -107,7 +107,7 @@ func (m *Module) DomainBlockGETHandler(c *gin.Context) {
export = i
}
- domainBlock, errWithCode := m.processor.AdminDomainBlockGet(c.Request.Context(), authed, domainBlockID, export)
+ domainBlock, errWithCode := m.processor.Admin().DomainBlockGet(c.Request.Context(), authed.Account, domainBlockID, export)
if errWithCode != nil {
apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGetV1)
return
diff --git a/internal/api/client/admin/domainblocksget.go b/internal/api/client/admin/domainblocksget.go
index 5e5fdc9b1..b459b2961 100644
--- a/internal/api/client/admin/domainblocksget.go
+++ b/internal/api/client/admin/domainblocksget.go
@@ -105,7 +105,7 @@ func (m *Module) DomainBlocksGETHandler(c *gin.Context) {
export = i
}
- domainBlocks, errWithCode := m.processor.AdminDomainBlocksGet(c.Request.Context(), authed, export)
+ domainBlocks, errWithCode := m.processor.Admin().DomainBlocksGet(c.Request.Context(), authed.Account, export)
if errWithCode != nil {
apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGetV1)
return
diff --git a/internal/api/client/admin/emojicategoriesget.go b/internal/api/client/admin/emojicategoriesget.go
index 890889314..1bb5e5d40 100644
--- a/internal/api/client/admin/emojicategoriesget.go
+++ b/internal/api/client/admin/emojicategoriesget.go
@@ -84,7 +84,7 @@ func (m *Module) EmojiCategoriesGETHandler(c *gin.Context) {
return
}
- categories, errWithCode := m.processor.AdminEmojiCategoriesGet(c.Request.Context())
+ categories, errWithCode := m.processor.Admin().EmojiCategoriesGet(c.Request.Context())
if errWithCode != nil {
apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGetV1)
return
diff --git a/internal/api/client/admin/emojicreate.go b/internal/api/client/admin/emojicreate.go
index 758da3d5b..2ef5f518e 100644
--- a/internal/api/client/admin/emojicreate.go
+++ b/internal/api/client/admin/emojicreate.go
@@ -126,7 +126,7 @@ func (m *Module) EmojiCreatePOSTHandler(c *gin.Context) {
return
}
- apiEmoji, errWithCode := m.processor.AdminEmojiCreate(c.Request.Context(), authed, form)
+ apiEmoji, errWithCode := m.processor.Admin().EmojiCreate(c.Request.Context(), authed.Account, authed.User, form)
if errWithCode != nil {
apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGetV1)
return
diff --git a/internal/api/client/admin/emojidelete.go b/internal/api/client/admin/emojidelete.go
index 0fe28b8c3..a402edda4 100644
--- a/internal/api/client/admin/emojidelete.go
+++ b/internal/api/client/admin/emojidelete.go
@@ -100,7 +100,7 @@ func (m *Module) EmojiDELETEHandler(c *gin.Context) {
return
}
- emoji, errWithCode := m.processor.AdminEmojiDelete(c.Request.Context(), authed, emojiID)
+ emoji, errWithCode := m.processor.Admin().EmojiDelete(c.Request.Context(), emojiID)
if errWithCode != nil {
apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGetV1)
return
diff --git a/internal/api/client/admin/emojiget.go b/internal/api/client/admin/emojiget.go
index 44f63e3b6..ab03f637d 100644
--- a/internal/api/client/admin/emojiget.go
+++ b/internal/api/client/admin/emojiget.go
@@ -90,7 +90,7 @@ func (m *Module) EmojiGETHandler(c *gin.Context) {
return
}
- emoji, errWithCode := m.processor.AdminEmojiGet(c.Request.Context(), authed, emojiID)
+ emoji, errWithCode := m.processor.Admin().EmojiGet(c.Request.Context(), authed.Account, authed.User, emojiID)
if errWithCode != nil {
apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGetV1)
return
diff --git a/internal/api/client/admin/emojisget.go b/internal/api/client/admin/emojisget.go
index 455683efb..e727f4915 100644
--- a/internal/api/client/admin/emojisget.go
+++ b/internal/api/client/admin/emojisget.go
@@ -198,7 +198,7 @@ func (m *Module) EmojisGETHandler(c *gin.Context) {
includeEnabled = true
}
- resp, errWithCode := m.processor.AdminEmojisGet(c.Request.Context(), authed, domain, includeDisabled, includeEnabled, shortcode, maxShortcodeDomain, minShortcodeDomain, limit)
+ resp, errWithCode := m.processor.Admin().EmojisGet(c.Request.Context(), authed.Account, authed.User, domain, includeDisabled, includeEnabled, shortcode, maxShortcodeDomain, minShortcodeDomain, limit)
if errWithCode != nil {
apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGetV1)
return
diff --git a/internal/api/client/admin/emojiupdate.go b/internal/api/client/admin/emojiupdate.go
index e94eacb83..b850e1181 100644
--- a/internal/api/client/admin/emojiupdate.go
+++ b/internal/api/client/admin/emojiupdate.go
@@ -156,7 +156,7 @@ func (m *Module) EmojiPATCHHandler(c *gin.Context) {
return
}
- emoji, errWithCode := m.processor.AdminEmojiUpdate(c.Request.Context(), emojiID, form)
+ emoji, errWithCode := m.processor.Admin().EmojiUpdate(c.Request.Context(), emojiID, form)
if errWithCode != nil {
apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGetV1)
return
diff --git a/internal/api/client/admin/mediacleanup.go b/internal/api/client/admin/mediacleanup.go
index 3d10deb4a..98bebd70a 100644
--- a/internal/api/client/admin/mediacleanup.go
+++ b/internal/api/client/admin/mediacleanup.go
@@ -98,7 +98,7 @@ func (m *Module) MediaCleanupPOSTHandler(c *gin.Context) {
remoteCacheDays = 0
}
- if errWithCode := m.processor.AdminMediaPrune(c.Request.Context(), remoteCacheDays); errWithCode != nil {
+ if errWithCode := m.processor.Admin().MediaPrune(c.Request.Context(), remoteCacheDays); errWithCode != nil {
apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGetV1)
return
}
diff --git a/internal/api/client/admin/mediarefetch.go b/internal/api/client/admin/mediarefetch.go
index 9d86c60dd..746fe6e75 100644
--- a/internal/api/client/admin/mediarefetch.go
+++ b/internal/api/client/admin/mediarefetch.go
@@ -84,7 +84,7 @@ func (m *Module) MediaRefetchPOSTHandler(c *gin.Context) {
return
}
- if errWithCode := m.processor.AdminMediaRefetch(c.Request.Context(), authed, c.Query(DomainQueryKey)); errWithCode != nil {
+ if errWithCode := m.processor.Admin().MediaRefetch(c.Request.Context(), authed.Account, c.Query(DomainQueryKey)); errWithCode != nil {
apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGetV1)
return
}
diff --git a/internal/api/client/admin/reportget.go b/internal/api/client/admin/reportget.go
index 8b8040b8e..b9c25d895 100644
--- a/internal/api/client/admin/reportget.go
+++ b/internal/api/client/admin/reportget.go
@@ -93,7 +93,7 @@ func (m *Module) ReportGETHandler(c *gin.Context) {
return
}
- report, errWithCode := m.processor.AdminReportGet(c.Request.Context(), authed, reportID)
+ report, errWithCode := m.processor.Admin().ReportGet(c.Request.Context(), authed.Account, reportID)
if errWithCode != nil {
apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGetV1)
return
diff --git a/internal/api/client/admin/reportresolve.go b/internal/api/client/admin/reportresolve.go
index 485a5d45d..494f26dd0 100644
--- a/internal/api/client/admin/reportresolve.go
+++ b/internal/api/client/admin/reportresolve.go
@@ -115,7 +115,7 @@ func (m *Module) ReportResolvePOSTHandler(c *gin.Context) {
return
}
- report, errWithCode := m.processor.AdminReportResolve(c.Request.Context(), authed, reportID, form.ActionTakenComment)
+ report, errWithCode := m.processor.Admin().ReportResolve(c.Request.Context(), authed.Account, reportID, form.ActionTakenComment)
if errWithCode != nil {
apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGetV1)
return
diff --git a/internal/api/client/admin/reportsget.go b/internal/api/client/admin/reportsget.go
index 3c867d3f9..b41877b84 100644
--- a/internal/api/client/admin/reportsget.go
+++ b/internal/api/client/admin/reportsget.go
@@ -171,7 +171,7 @@ func (m *Module) ReportsGETHandler(c *gin.Context) {
limit = i
}
- resp, errWithCode := m.processor.AdminReportsGet(c.Request.Context(), authed, resolved, c.Query(AccountIDKey), c.Query(TargetAccountIDKey), c.Query(MaxIDKey), c.Query(SinceIDKey), c.Query(MinIDKey), limit)
+ resp, errWithCode := m.processor.Admin().ReportsGet(c.Request.Context(), authed.Account, resolved, c.Query(AccountIDKey), c.Query(TargetAccountIDKey), c.Query(MaxIDKey), c.Query(SinceIDKey), c.Query(MinIDKey), limit)
if errWithCode != nil {
apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGetV1)
return
diff --git a/internal/api/client/apps/apps.go b/internal/api/client/apps/apps.go
index 0a4926622..c7301d88b 100644
--- a/internal/api/client/apps/apps.go
+++ b/internal/api/client/apps/apps.go
@@ -29,10 +29,10 @@ import (
const BasePath = "/v1/apps"
type Module struct {
- processor processing.Processor
+ processor *processing.Processor
}
-func New(processor processing.Processor) *Module {
+func New(processor *processing.Processor) *Module {
return &Module{
processor: processor,
}
diff --git a/internal/api/client/blocks/blocks.go b/internal/api/client/blocks/blocks.go
index bf304e477..b1ee74a10 100644
--- a/internal/api/client/blocks/blocks.go
+++ b/internal/api/client/blocks/blocks.go
@@ -38,10 +38,10 @@ const (
)
type Module struct {
- processor processing.Processor
+ processor *processing.Processor
}
-func New(processor processing.Processor) *Module {
+func New(processor *processing.Processor) *Module {
return &Module{
processor: processor,
}
diff --git a/internal/api/client/bookmarks/bookmarks.go b/internal/api/client/bookmarks/bookmarks.go
index 612bec223..6be8919bd 100644
--- a/internal/api/client/bookmarks/bookmarks.go
+++ b/internal/api/client/bookmarks/bookmarks.go
@@ -31,10 +31,10 @@ const (
)
type Module struct {
- processor processing.Processor
+ processor *processing.Processor
}
-func New(processor processing.Processor) *Module {
+func New(processor *processing.Processor) *Module {
return &Module{
processor: processor,
}
diff --git a/internal/api/client/bookmarks/bookmarks_test.go b/internal/api/client/bookmarks/bookmarks_test.go
index f4b82a8e1..fac67ffe7 100644
--- a/internal/api/client/bookmarks/bookmarks_test.go
+++ b/internal/api/client/bookmarks/bookmarks_test.go
@@ -53,7 +53,7 @@ type BookmarkTestSuite struct {
mediaManager media.Manager
federator federation.Federator
emailSender email.Sender
- processor processing.Processor
+ processor *processing.Processor
storage *storage.Driver
// standard suite models
diff --git a/internal/api/client/bookmarks/bookmarksget.go b/internal/api/client/bookmarks/bookmarksget.go
index f5f43f0f4..23c32eba8 100644
--- a/internal/api/client/bookmarks/bookmarksget.go
+++ b/internal/api/client/bookmarks/bookmarksget.go
@@ -89,7 +89,7 @@ func (m *Module) BookmarksGETHandler(c *gin.Context) {
minID = minIDString
}
- resp, errWithCode := m.processor.BookmarksGet(c.Request.Context(), authed, maxID, minID, limit)
+ resp, errWithCode := m.processor.Account().BookmarksGet(c.Request.Context(), authed.Account, limit, maxID, minID)
if errWithCode != nil {
apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGetV1)
return
diff --git a/internal/api/client/customemojis/customemojis.go b/internal/api/client/customemojis/customemojis.go
index 3bddf7db8..528dd25f4 100644
--- a/internal/api/client/customemojis/customemojis.go
+++ b/internal/api/client/customemojis/customemojis.go
@@ -31,10 +31,10 @@ const (
)
type Module struct {
- processor processing.Processor
+ processor *processing.Processor
}
-func New(processor processing.Processor) *Module {
+func New(processor *processing.Processor) *Module {
return &Module{
processor: processor,
}
diff --git a/internal/api/client/customemojis/customemojisget.go b/internal/api/client/customemojis/customemojisget.go
index 79cb32acf..167c499d2 100644
--- a/internal/api/client/customemojis/customemojisget.go
+++ b/internal/api/client/customemojis/customemojisget.go
@@ -66,7 +66,7 @@ func (m *Module) CustomEmojisGETHandler(c *gin.Context) {
return
}
- emojis, errWithCode := m.processor.CustomEmojisGet(c)
+ emojis, errWithCode := m.processor.Media().GetCustomEmojis(c)
if errWithCode != nil {
apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGetV1)
return
diff --git a/internal/api/client/favourites/favourites.go b/internal/api/client/favourites/favourites.go
index 5b0a10bca..80204a63e 100644
--- a/internal/api/client/favourites/favourites.go
+++ b/internal/api/client/favourites/favourites.go
@@ -42,10 +42,10 @@ const (
)
type Module struct {
- processor processing.Processor
+ processor *processing.Processor
}
-func New(processor processing.Processor) *Module {
+func New(processor *processing.Processor) *Module {
return &Module{
processor: processor,
}
diff --git a/internal/api/client/favourites/favourites_test.go b/internal/api/client/favourites/favourites_test.go
index 5390706ae..7949aa38c 100644
--- a/internal/api/client/favourites/favourites_test.go
+++ b/internal/api/client/favourites/favourites_test.go
@@ -42,7 +42,7 @@ type FavouritesStandardTestSuite struct {
mediaManager media.Manager
federator federation.Federator
emailSender email.Sender
- processor processing.Processor
+ processor *processing.Processor
storage *storage.Driver
// standard suite models
diff --git a/internal/api/client/featuredtags/featuredtags.go b/internal/api/client/featuredtags/featuredtags.go
index 7cd61837c..a003e4c39 100644
--- a/internal/api/client/featuredtags/featuredtags.go
+++ b/internal/api/client/featuredtags/featuredtags.go
@@ -30,10 +30,10 @@ const (
)
type Module struct {
- processor processing.Processor
+ processor *processing.Processor
}
-func New(processor processing.Processor) *Module {
+func New(processor *processing.Processor) *Module {
return &Module{
processor: processor,
}
diff --git a/internal/api/client/filters/filter.go b/internal/api/client/filters/filter.go
index d66ff2ea5..dc6db2e63 100644
--- a/internal/api/client/filters/filter.go
+++ b/internal/api/client/filters/filter.go
@@ -31,10 +31,10 @@ const (
)
type Module struct {
- processor processing.Processor
+ processor *processing.Processor
}
-func New(processor processing.Processor) *Module {
+func New(processor *processing.Processor) *Module {
return &Module{
processor: processor,
}
diff --git a/internal/api/client/followrequests/followrequest.go b/internal/api/client/followrequests/followrequest.go
index 4898e9153..1d0c46ffc 100644
--- a/internal/api/client/followrequests/followrequest.go
+++ b/internal/api/client/followrequests/followrequest.go
@@ -40,10 +40,10 @@ const (
)
type Module struct {
- processor processing.Processor
+ processor *processing.Processor
}
-func New(processor processing.Processor) *Module {
+func New(processor *processing.Processor) *Module {
return &Module{
processor: processor,
}
diff --git a/internal/api/client/followrequests/followrequest_test.go b/internal/api/client/followrequests/followrequest_test.go
index 2af59ca3c..7a08479ab 100644
--- a/internal/api/client/followrequests/followrequest_test.go
+++ b/internal/api/client/followrequests/followrequest_test.go
@@ -46,7 +46,7 @@ type FollowRequestStandardTestSuite struct {
storage *storage.Driver
mediaManager media.Manager
federator federation.Federator
- processor processing.Processor
+ processor *processing.Processor
emailSender email.Sender
// standard suite models
diff --git a/internal/api/client/instance/instance.go b/internal/api/client/instance/instance.go
index d6f54a1ed..899dbfa77 100644
--- a/internal/api/client/instance/instance.go
+++ b/internal/api/client/instance/instance.go
@@ -33,10 +33,10 @@ const (
)
type Module struct {
- processor processing.Processor
+ processor *processing.Processor
}
-func New(processor processing.Processor) *Module {
+func New(processor *processing.Processor) *Module {
return &Module{
processor: processor,
}
diff --git a/internal/api/client/instance/instance_test.go b/internal/api/client/instance/instance_test.go
index a828a6114..ff622febe 100644
--- a/internal/api/client/instance/instance_test.go
+++ b/internal/api/client/instance/instance_test.go
@@ -47,7 +47,7 @@ type InstanceStandardTestSuite struct {
storage *storage.Driver
mediaManager media.Manager
federator federation.Federator
- processor processing.Processor
+ processor *processing.Processor
emailSender email.Sender
sentEmails map[string]string
diff --git a/internal/api/client/lists/list.go b/internal/api/client/lists/list.go
index 457d7a3ea..6e09313ae 100644
--- a/internal/api/client/lists/list.go
+++ b/internal/api/client/lists/list.go
@@ -31,10 +31,10 @@ const (
)
type Module struct {
- processor processing.Processor
+ processor *processing.Processor
}
-func New(processor processing.Processor) *Module {
+func New(processor *processing.Processor) *Module {
return &Module{
processor: processor,
}
diff --git a/internal/api/client/media/media.go b/internal/api/client/media/media.go
index e6d0c212c..65c12a329 100644
--- a/internal/api/client/media/media.go
+++ b/internal/api/client/media/media.go
@@ -35,10 +35,10 @@ const (
)
type Module struct {
- processor processing.Processor
+ processor *processing.Processor
}
-func New(processor processing.Processor) *Module {
+func New(processor *processing.Processor) *Module {
return &Module{
processor: processor,
}
diff --git a/internal/api/client/media/mediacreate.go b/internal/api/client/media/mediacreate.go
index cfd547c19..71a43eafd 100644
--- a/internal/api/client/media/mediacreate.go
+++ b/internal/api/client/media/mediacreate.go
@@ -123,7 +123,7 @@ func (m *Module) MediaCreatePOSTHandler(c *gin.Context) {
return
}
- apiAttachment, errWithCode := m.processor.MediaCreate(c.Request.Context(), authed, form)
+ apiAttachment, errWithCode := m.processor.Media().Create(c.Request.Context(), authed.Account, form)
if errWithCode != nil {
apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGetV1)
return
diff --git a/internal/api/client/media/mediacreate_test.go b/internal/api/client/media/mediacreate_test.go
index 8a94646ac..aaace7a61 100644
--- a/internal/api/client/media/mediacreate_test.go
+++ b/internal/api/client/media/mediacreate_test.go
@@ -59,7 +59,7 @@ type MediaCreateTestSuite struct {
tc typeutils.TypeConverter
oauthServer oauth.Server
emailSender email.Sender
- processor processing.Processor
+ processor *processing.Processor
// standard suite models
testTokens map[string]*gtsmodel.Token
diff --git a/internal/api/client/media/mediaget.go b/internal/api/client/media/mediaget.go
index 2c07024c2..f7656b574 100644
--- a/internal/api/client/media/mediaget.go
+++ b/internal/api/client/media/mediaget.go
@@ -91,7 +91,7 @@ func (m *Module) MediaGETHandler(c *gin.Context) {
return
}
- attachment, errWithCode := m.processor.MediaGet(c.Request.Context(), authed, attachmentID)
+ attachment, errWithCode := m.processor.Media().Get(c.Request.Context(), authed.Account, attachmentID)
if errWithCode != nil {
apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGetV1)
return
diff --git a/internal/api/client/media/mediaupdate.go b/internal/api/client/media/mediaupdate.go
index a0c44caf3..fa0b10ab5 100644
--- a/internal/api/client/media/mediaupdate.go
+++ b/internal/api/client/media/mediaupdate.go
@@ -134,7 +134,7 @@ func (m *Module) MediaPUTHandler(c *gin.Context) {
return
}
- attachment, errWithCode := m.processor.MediaUpdate(c.Request.Context(), authed, attachmentID, form)
+ attachment, errWithCode := m.processor.Media().Update(c.Request.Context(), authed.Account, attachmentID, form)
if errWithCode != nil {
apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGetV1)
return
diff --git a/internal/api/client/media/mediaupdate_test.go b/internal/api/client/media/mediaupdate_test.go
index 8f4470132..cb96e8aa1 100644
--- a/internal/api/client/media/mediaupdate_test.go
+++ b/internal/api/client/media/mediaupdate_test.go
@@ -57,7 +57,7 @@ type MediaUpdateTestSuite struct {
mediaManager media.Manager
oauthServer oauth.Server
emailSender email.Sender
- processor processing.Processor
+ processor *processing.Processor
// standard suite models
testTokens map[string]*gtsmodel.Token
diff --git a/internal/api/client/notifications/notifications.go b/internal/api/client/notifications/notifications.go
index 85d52f249..2292f8c9a 100644
--- a/internal/api/client/notifications/notifications.go
+++ b/internal/api/client/notifications/notifications.go
@@ -46,10 +46,10 @@ const (
)
type Module struct {
- processor processing.Processor
+ processor *processing.Processor
}
-func New(processor processing.Processor) *Module {
+func New(processor *processing.Processor) *Module {
return &Module{
processor: processor,
}
diff --git a/internal/api/client/reports/reportcreate.go b/internal/api/client/reports/reportcreate.go
index a5f14c6b3..44a62dbc2 100644
--- a/internal/api/client/reports/reportcreate.go
+++ b/internal/api/client/reports/reportcreate.go
@@ -102,7 +102,7 @@ func (m *Module) ReportPOSTHandler(c *gin.Context) {
return
}
- apiReport, errWithCode := m.processor.ReportCreate(c.Request.Context(), authed, form)
+ apiReport, errWithCode := m.processor.Report().Create(c.Request.Context(), authed.Account, form)
if errWithCode != nil {
apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGetV1)
return
diff --git a/internal/api/client/reports/reportget.go b/internal/api/client/reports/reportget.go
index 8b08da048..0c478e045 100644
--- a/internal/api/client/reports/reportget.go
+++ b/internal/api/client/reports/reportget.go
@@ -85,7 +85,7 @@ func (m *Module) ReportGETHandler(c *gin.Context) {
return
}
- report, errWithCode := m.processor.ReportGet(c.Request.Context(), authed, targetReportID)
+ report, errWithCode := m.processor.Report().Get(c.Request.Context(), authed.Account, targetReportID)
if errWithCode != nil {
apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGetV1)
return
diff --git a/internal/api/client/reports/reports.go b/internal/api/client/reports/reports.go
index 41b61582c..3dcdb8d0f 100644
--- a/internal/api/client/reports/reports.go
+++ b/internal/api/client/reports/reports.go
@@ -38,10 +38,10 @@ const (
)
type Module struct {
- processor processing.Processor
+ processor *processing.Processor
}
-func New(processor processing.Processor) *Module {
+func New(processor *processing.Processor) *Module {
return &Module{
processor: processor,
}
diff --git a/internal/api/client/reports/reports_test.go b/internal/api/client/reports/reports_test.go
index f5f5bf91e..1c5a532b9 100644
--- a/internal/api/client/reports/reports_test.go
+++ b/internal/api/client/reports/reports_test.go
@@ -39,7 +39,7 @@ type ReportsStandardTestSuite struct {
storage *storage.Driver
mediaManager media.Manager
federator federation.Federator
- processor processing.Processor
+ processor *processing.Processor
emailSender email.Sender
sentEmails map[string]string
diff --git a/internal/api/client/reports/reportsget.go b/internal/api/client/reports/reportsget.go
index b53c9527d..ca135be21 100644
--- a/internal/api/client/reports/reportsget.go
+++ b/internal/api/client/reports/reportsget.go
@@ -160,7 +160,7 @@ func (m *Module) ReportsGETHandler(c *gin.Context) {
limit = i
}
- resp, errWithCode := m.processor.ReportsGet(c.Request.Context(), authed, resolved, c.Query(TargetAccountIDKey), c.Query(MaxIDKey), c.Query(SinceIDKey), c.Query(MinIDKey), limit)
+ resp, errWithCode := m.processor.Report().GetMultiple(c.Request.Context(), authed.Account, resolved, c.Query(TargetAccountIDKey), c.Query(MaxIDKey), c.Query(SinceIDKey), c.Query(MinIDKey), limit)
if errWithCode != nil {
apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGetV1)
return
diff --git a/internal/api/client/search/search.go b/internal/api/client/search/search.go
index c9f23595a..1ab9e0739 100644
--- a/internal/api/client/search/search.go
+++ b/internal/api/client/search/search.go
@@ -62,10 +62,10 @@ const (
)
type Module struct {
- processor processing.Processor
+ processor *processing.Processor
}
-func New(processor processing.Processor) *Module {
+func New(processor *processing.Processor) *Module {
return &Module{
processor: processor,
}
diff --git a/internal/api/client/search/search_test.go b/internal/api/client/search/search_test.go
index 194115525..4580f6f9d 100644
--- a/internal/api/client/search/search_test.go
+++ b/internal/api/client/search/search_test.go
@@ -47,7 +47,7 @@ type SearchStandardTestSuite struct {
storage *storage.Driver
mediaManager media.Manager
federator federation.Federator
- processor processing.Processor
+ processor *processing.Processor
emailSender email.Sender
sentEmails map[string]string
diff --git a/internal/api/client/statuses/status.go b/internal/api/client/statuses/status.go
index 65129ee7e..380846ed4 100644
--- a/internal/api/client/statuses/status.go
+++ b/internal/api/client/statuses/status.go
@@ -68,10 +68,10 @@ const (
)
type Module struct {
- processor processing.Processor
+ processor *processing.Processor
}
-func New(processor processing.Processor) *Module {
+func New(processor *processing.Processor) *Module {
return &Module{
processor: processor,
}
diff --git a/internal/api/client/statuses/status_test.go b/internal/api/client/statuses/status_test.go
index 29746ed80..a87fd36f7 100644
--- a/internal/api/client/statuses/status_test.go
+++ b/internal/api/client/statuses/status_test.go
@@ -42,7 +42,7 @@ type StatusStandardTestSuite struct {
mediaManager media.Manager
federator federation.Federator
emailSender email.Sender
- processor processing.Processor
+ processor *processing.Processor
storage *storage.Driver
// standard suite models
diff --git a/internal/api/client/statuses/statusbookmark.go b/internal/api/client/statuses/statusbookmark.go
index ca2597c03..0b969f3f2 100644
--- a/internal/api/client/statuses/statusbookmark.go
+++ b/internal/api/client/statuses/statusbookmark.go
@@ -88,7 +88,7 @@ func (m *Module) StatusBookmarkPOSTHandler(c *gin.Context) {
return
}
- apiStatus, errWithCode := m.processor.StatusBookmark(c.Request.Context(), authed, targetStatusID)
+ apiStatus, errWithCode := m.processor.Status().BookmarkCreate(c.Request.Context(), authed.Account, targetStatusID)
if errWithCode != nil {
apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGetV1)
return
diff --git a/internal/api/client/statuses/statusboost.go b/internal/api/client/statuses/statusboost.go
index fe66afb54..f4152a9b0 100644
--- a/internal/api/client/statuses/statusboost.go
+++ b/internal/api/client/statuses/statusboost.go
@@ -91,7 +91,7 @@ func (m *Module) StatusBoostPOSTHandler(c *gin.Context) {
return
}
- apiStatus, errWithCode := m.processor.StatusBoost(c.Request.Context(), authed, targetStatusID)
+ apiStatus, errWithCode := m.processor.Status().BoostCreate(c.Request.Context(), authed.Account, authed.Application, targetStatusID)
if errWithCode != nil {
apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGetV1)
return
diff --git a/internal/api/client/statuses/statusboostedby.go b/internal/api/client/statuses/statusboostedby.go
index 1131a3ef0..b9720a749 100644
--- a/internal/api/client/statuses/statusboostedby.go
+++ b/internal/api/client/statuses/statusboostedby.go
@@ -79,7 +79,7 @@ func (m *Module) StatusBoostedByGETHandler(c *gin.Context) {
return
}
- apiAccounts, errWithCode := m.processor.StatusBoostedBy(c.Request.Context(), authed, targetStatusID)
+ apiAccounts, errWithCode := m.processor.Status().StatusBoostedBy(c.Request.Context(), authed.Account, targetStatusID)
if errWithCode != nil {
apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGetV1)
return
diff --git a/internal/api/client/statuses/statuscontext.go b/internal/api/client/statuses/statuscontext.go
index 60f122cb6..8a293ea38 100644
--- a/internal/api/client/statuses/statuscontext.go
+++ b/internal/api/client/statuses/statuscontext.go
@@ -90,7 +90,7 @@ func (m *Module) StatusContextGETHandler(c *gin.Context) {
return
}
- statusContext, errWithCode := m.processor.StatusGetContext(c.Request.Context(), authed, targetStatusID)
+ statusContext, errWithCode := m.processor.Status().ContextGet(c.Request.Context(), authed.Account, targetStatusID)
if errWithCode != nil {
apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGetV1)
return
diff --git a/internal/api/client/statuses/statuscreate.go b/internal/api/client/statuses/statuscreate.go
index c9dc3a593..02d782592 100644
--- a/internal/api/client/statuses/statuscreate.go
+++ b/internal/api/client/statuses/statuscreate.go
@@ -104,7 +104,7 @@ func (m *Module) StatusCreatePOSTHandler(c *gin.Context) {
return
}
- apiStatus, errWithCode := m.processor.StatusCreate(c.Request.Context(), authed, form)
+ apiStatus, errWithCode := m.processor.Status().Create(c.Request.Context(), authed.Account, authed.Application, form)
if errWithCode != nil {
apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGetV1)
return
diff --git a/internal/api/client/statuses/statusdelete.go b/internal/api/client/statuses/statusdelete.go
index 44241eeb2..1e9c11499 100644
--- a/internal/api/client/statuses/statusdelete.go
+++ b/internal/api/client/statuses/statusdelete.go
@@ -90,7 +90,7 @@ func (m *Module) StatusDELETEHandler(c *gin.Context) {
return
}
- apiStatus, errWithCode := m.processor.StatusDelete(c.Request.Context(), authed, targetStatusID)
+ apiStatus, errWithCode := m.processor.Status().Delete(c.Request.Context(), authed.Account, targetStatusID)
if errWithCode != nil {
apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGetV1)
return
diff --git a/internal/api/client/statuses/statusfave.go b/internal/api/client/statuses/statusfave.go
index ea111757d..47e6f1eb1 100644
--- a/internal/api/client/statuses/statusfave.go
+++ b/internal/api/client/statuses/statusfave.go
@@ -87,7 +87,7 @@ func (m *Module) StatusFavePOSTHandler(c *gin.Context) {
return
}
- apiStatus, errWithCode := m.processor.StatusFave(c.Request.Context(), authed, targetStatusID)
+ apiStatus, errWithCode := m.processor.Status().FaveCreate(c.Request.Context(), authed.Account, targetStatusID)
if errWithCode != nil {
apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGetV1)
return
diff --git a/internal/api/client/statuses/statusfavedby.go b/internal/api/client/statuses/statusfavedby.go
index 1991402cb..45b86c22f 100644
--- a/internal/api/client/statuses/statusfavedby.go
+++ b/internal/api/client/statuses/statusfavedby.go
@@ -88,7 +88,7 @@ func (m *Module) StatusFavedByGETHandler(c *gin.Context) {
return
}
- apiAccounts, errWithCode := m.processor.StatusFavedBy(c.Request.Context(), authed, targetStatusID)
+ apiAccounts, errWithCode := m.processor.Status().FavedBy(c.Request.Context(), authed.Account, targetStatusID)
if errWithCode != nil {
apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGetV1)
return
diff --git a/internal/api/client/statuses/statusget.go b/internal/api/client/statuses/statusget.go
index 17016bf48..55827d620 100644
--- a/internal/api/client/statuses/statusget.go
+++ b/internal/api/client/statuses/statusget.go
@@ -87,7 +87,7 @@ func (m *Module) StatusGETHandler(c *gin.Context) {
return
}
- apiStatus, errWithCode := m.processor.StatusGet(c.Request.Context(), authed, targetStatusID)
+ apiStatus, errWithCode := m.processor.Status().Get(c.Request.Context(), authed.Account, targetStatusID)
if errWithCode != nil {
apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGetV1)
return
diff --git a/internal/api/client/statuses/statusunbookmark.go b/internal/api/client/statuses/statusunbookmark.go
index 8fbaadbe6..647ea7637 100644
--- a/internal/api/client/statuses/statusunbookmark.go
+++ b/internal/api/client/statuses/statusunbookmark.go
@@ -88,7 +88,7 @@ func (m *Module) StatusUnbookmarkPOSTHandler(c *gin.Context) {
return
}
- apiStatus, errWithCode := m.processor.StatusUnbookmark(c.Request.Context(), authed, targetStatusID)
+ apiStatus, errWithCode := m.processor.Status().BookmarkRemove(c.Request.Context(), authed.Account, targetStatusID)
if errWithCode != nil {
apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGetV1)
return
diff --git a/internal/api/client/statuses/statusunboost.go b/internal/api/client/statuses/statusunboost.go
index 41fa187da..911d65b4a 100644
--- a/internal/api/client/statuses/statusunboost.go
+++ b/internal/api/client/statuses/statusunboost.go
@@ -88,7 +88,7 @@ func (m *Module) StatusUnboostPOSTHandler(c *gin.Context) {
return
}
- apiStatus, errWithCode := m.processor.StatusUnboost(c.Request.Context(), authed, targetStatusID)
+ apiStatus, errWithCode := m.processor.Status().BoostRemove(c.Request.Context(), authed.Account, authed.Application, targetStatusID)
if errWithCode != nil {
apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGetV1)
return
diff --git a/internal/api/client/statuses/statusunfave.go b/internal/api/client/statuses/statusunfave.go
index e73500347..e54dd9d6e 100644
--- a/internal/api/client/statuses/statusunfave.go
+++ b/internal/api/client/statuses/statusunfave.go
@@ -87,7 +87,7 @@ func (m *Module) StatusUnfavePOSTHandler(c *gin.Context) {
return
}
- apiStatus, errWithCode := m.processor.StatusUnfave(c.Request.Context(), authed, targetStatusID)
+ apiStatus, errWithCode := m.processor.Status().FaveRemove(c.Request.Context(), authed.Account, targetStatusID)
if errWithCode != nil {
apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGetV1)
return
diff --git a/internal/api/client/streaming/stream.go b/internal/api/client/streaming/stream.go
index a03f36d16..444157c1b 100644
--- a/internal/api/client/streaming/stream.go
+++ b/internal/api/client/streaming/stream.go
@@ -154,13 +154,13 @@ func (m *Module) StreamGETHandler(c *gin.Context) {
}
}
- account, errWithCode := m.processor.AuthorizeStreamingRequest(c.Request.Context(), token)
+ account, errWithCode := m.processor.Stream().Authorize(c.Request.Context(), token)
if errWithCode != nil {
apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGetV1)
return
}
- stream, errWithCode := m.processor.OpenStreamForAccount(c.Request.Context(), account, streamType)
+ stream, errWithCode := m.processor.Stream().Open(c.Request.Context(), account, streamType)
if errWithCode != nil {
apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGetV1)
return
diff --git a/internal/api/client/streaming/streaming.go b/internal/api/client/streaming/streaming.go
index d4c61f7a0..1c755a2ca 100644
--- a/internal/api/client/streaming/streaming.go
+++ b/internal/api/client/streaming/streaming.go
@@ -42,12 +42,12 @@ const (
)
type Module struct {
- processor processing.Processor
+ processor *processing.Processor
dTicker time.Duration
wsUpgrade websocket.Upgrader
}
-func New(processor processing.Processor, dTicker time.Duration, wsBuf int) *Module {
+func New(processor *processing.Processor, dTicker time.Duration, wsBuf int) *Module {
return &Module{
processor: processor,
dTicker: dTicker,
diff --git a/internal/api/client/streaming/streaming_test.go b/internal/api/client/streaming/streaming_test.go
index f713607bb..5fb470af8 100644
--- a/internal/api/client/streaming/streaming_test.go
+++ b/internal/api/client/streaming/streaming_test.go
@@ -54,7 +54,7 @@ type StreamingTestSuite struct {
mediaManager media.Manager
federator federation.Federator
emailSender email.Sender
- processor processing.Processor
+ processor *processing.Processor
storage *storage.Driver
// standard suite models
diff --git a/internal/api/client/timelines/timeline.go b/internal/api/client/timelines/timeline.go
index de494320a..276460d98 100644
--- a/internal/api/client/timelines/timeline.go
+++ b/internal/api/client/timelines/timeline.go
@@ -45,10 +45,10 @@ const (
)
type Module struct {
- processor processing.Processor
+ processor *processing.Processor
}
-func New(processor processing.Processor) *Module {
+func New(processor *processing.Processor) *Module {
return &Module{
processor: processor,
}
diff --git a/internal/api/client/user/passwordchange.go b/internal/api/client/user/passwordchange.go
index c2b5c598d..f0cfe3dd6 100644
--- a/internal/api/client/user/passwordchange.go
+++ b/internal/api/client/user/passwordchange.go
@@ -95,7 +95,7 @@ func (m *Module) PasswordChangePOSTHandler(c *gin.Context) {
return
}
- if errWithCode := m.processor.UserChangePassword(c.Request.Context(), authed, form); errWithCode != nil {
+ if errWithCode := m.processor.User().PasswordChange(c.Request.Context(), authed.User, form.OldPassword, form.NewPassword); errWithCode != nil {
apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGetV1)
return
}
diff --git a/internal/api/client/user/user.go b/internal/api/client/user/user.go
index f09984380..1117db08f 100644
--- a/internal/api/client/user/user.go
+++ b/internal/api/client/user/user.go
@@ -33,10 +33,10 @@ const (
)
type Module struct {
- processor processing.Processor
+ processor *processing.Processor
}
-func New(processor processing.Processor) *Module {
+func New(processor *processing.Processor) *Module {
return &Module{
processor: processor,
}
diff --git a/internal/api/client/user/user_test.go b/internal/api/client/user/user_test.go
index 27058d5ca..c990abb56 100644
--- a/internal/api/client/user/user_test.go
+++ b/internal/api/client/user/user_test.go
@@ -41,7 +41,7 @@ type UserStandardTestSuite struct {
mediaManager media.Manager
federator federation.Federator
emailSender email.Sender
- processor processing.Processor
+ processor *processing.Processor
storage *storage.Driver
testTokens map[string]*gtsmodel.Token
diff --git a/internal/api/fileserver.go b/internal/api/fileserver.go
index b1ebae045..cdc252780 100644
--- a/internal/api/fileserver.go
+++ b/internal/api/fileserver.go
@@ -54,7 +54,7 @@ func (f *Fileserver) Route(r router.Router, m ...gin.HandlerFunc) {
f.fileserver.Route(fileserverGroup.Handle)
}
-func NewFileserver(p processing.Processor) *Fileserver {
+func NewFileserver(p *processing.Processor) *Fileserver {
return &Fileserver{
fileserver: fileserver.New(p),
}
diff --git a/internal/api/fileserver/fileserver.go b/internal/api/fileserver/fileserver.go
index ba2552caa..aa4696f6f 100644
--- a/internal/api/fileserver/fileserver.go
+++ b/internal/api/fileserver/fileserver.go
@@ -39,10 +39,10 @@ const (
)
type Module struct {
- processor processing.Processor
+ processor *processing.Processor
}
-func New(processor processing.Processor) *Module {
+func New(processor *processing.Processor) *Module {
return &Module{
processor: processor,
}
diff --git a/internal/api/fileserver/fileserver_test.go b/internal/api/fileserver/fileserver_test.go
index 5b139454e..0a6879e70 100644
--- a/internal/api/fileserver/fileserver_test.go
+++ b/internal/api/fileserver/fileserver_test.go
@@ -45,7 +45,7 @@ type FileserverTestSuite struct {
storage *storage.Driver
federator federation.Federator
tc typeutils.TypeConverter
- processor processing.Processor
+ processor *processing.Processor
mediaManager media.Manager
oauthServer oauth.Server
emailSender email.Sender
diff --git a/internal/api/fileserver/servefile.go b/internal/api/fileserver/servefile.go
index a344e3e53..d963df749 100644
--- a/internal/api/fileserver/servefile.go
+++ b/internal/api/fileserver/servefile.go
@@ -80,7 +80,7 @@ func (m *Module) ServeFile(c *gin.Context) {
// Acquire context from gin request.
ctx := c.Request.Context()
- content, errWithCode := m.processor.FileGet(ctx, authed, &apimodel.GetContentRequestForm{
+ content, errWithCode := m.processor.Media().GetFile(ctx, authed.Account, &apimodel.GetContentRequestForm{
AccountID: accountID,
MediaType: mediaType,
MediaSize: mediaSize,
diff --git a/internal/api/nodeinfo.go b/internal/api/nodeinfo.go
index 717d00359..bf0ff5815 100644
--- a/internal/api/nodeinfo.go
+++ b/internal/api/nodeinfo.go
@@ -44,7 +44,7 @@ func (w *NodeInfo) Route(r router.Router, m ...gin.HandlerFunc) {
w.nodeInfo.Route(nodeInfoGroup.Handle)
}
-func NewNodeInfo(p processing.Processor) *NodeInfo {
+func NewNodeInfo(p *processing.Processor) *NodeInfo {
return &NodeInfo{
nodeInfo: nodeinfo.New(p),
}
diff --git a/internal/api/nodeinfo/nodeinfo.go b/internal/api/nodeinfo/nodeinfo.go
index ba125d894..07ed471b9 100644
--- a/internal/api/nodeinfo/nodeinfo.go
+++ b/internal/api/nodeinfo/nodeinfo.go
@@ -32,10 +32,10 @@ const (
)
type Module struct {
- processor processing.Processor
+ processor *processing.Processor
}
-func New(processor processing.Processor) *Module {
+func New(processor *processing.Processor) *Module {
return &Module{
processor: processor,
}
diff --git a/internal/api/nodeinfo/nodeinfoget.go b/internal/api/nodeinfo/nodeinfoget.go
index 59fcf2f55..9660d46dc 100644
--- a/internal/api/nodeinfo/nodeinfoget.go
+++ b/internal/api/nodeinfo/nodeinfoget.go
@@ -50,7 +50,7 @@ func (m *Module) NodeInfo2GETHandler(c *gin.Context) {
return
}
- nodeInfo, errWithCode := m.processor.GetNodeInfo(c.Request.Context())
+ nodeInfo, errWithCode := m.processor.Fedi().NodeInfoGet(c.Request.Context())
if errWithCode != nil {
apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGetV1)
return
diff --git a/internal/api/wellknown.go b/internal/api/wellknown.go
index 91433643a..7edbb4d7d 100644
--- a/internal/api/wellknown.go
+++ b/internal/api/wellknown.go
@@ -47,7 +47,7 @@ func (w *WellKnown) Route(r router.Router, m ...gin.HandlerFunc) {
w.webfinger.Route(wellKnownGroup.Handle)
}
-func NewWellKnown(p processing.Processor) *WellKnown {
+func NewWellKnown(p *processing.Processor) *WellKnown {
return &WellKnown{
nodeInfo: nodeinfo.New(p),
webfinger: webfinger.New(p),
diff --git a/internal/api/wellknown/nodeinfo/nodeinfo.go b/internal/api/wellknown/nodeinfo/nodeinfo.go
index 70cbb2770..2ce172c42 100644
--- a/internal/api/wellknown/nodeinfo/nodeinfo.go
+++ b/internal/api/wellknown/nodeinfo/nodeinfo.go
@@ -32,11 +32,11 @@ const (
)
type Module struct {
- processor processing.Processor
+ processor *processing.Processor
}
// New returns a new nodeinfo module
-func New(processor processing.Processor) *Module {
+func New(processor *processing.Processor) *Module {
return &Module{
processor: processor,
}
diff --git a/internal/api/wellknown/nodeinfo/nodeinfoget.go b/internal/api/wellknown/nodeinfo/nodeinfoget.go
index 8bfab072d..63ef264fa 100644
--- a/internal/api/wellknown/nodeinfo/nodeinfoget.go
+++ b/internal/api/wellknown/nodeinfo/nodeinfoget.go
@@ -50,7 +50,7 @@ func (m *Module) NodeInfoWellKnownGETHandler(c *gin.Context) {
return
}
- resp, errWithCode := m.processor.GetNodeInfoRel(c.Request.Context())
+ resp, errWithCode := m.processor.Fedi().NodeInfoRelGet(c.Request.Context())
if errWithCode != nil {
apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGetV1)
return
diff --git a/internal/api/wellknown/webfinger/webfinger.go b/internal/api/wellknown/webfinger/webfinger.go
index d3f9287e5..ac2ba2acd 100644
--- a/internal/api/wellknown/webfinger/webfinger.go
+++ b/internal/api/wellknown/webfinger/webfinger.go
@@ -32,10 +32,10 @@ const (
)
type Module struct {
- processor processing.Processor
+ processor *processing.Processor
}
-func New(processor processing.Processor) *Module {
+func New(processor *processing.Processor) *Module {
return &Module{
processor: processor,
}
diff --git a/internal/api/wellknown/webfinger/webfinger_test.go b/internal/api/wellknown/webfinger/webfinger_test.go
index df72e1722..38228e928 100644
--- a/internal/api/wellknown/webfinger/webfinger_test.go
+++ b/internal/api/wellknown/webfinger/webfinger_test.go
@@ -48,7 +48,7 @@ type WebfingerStandardTestSuite struct {
mediaManager media.Manager
federator federation.Federator
emailSender email.Sender
- processor processing.Processor
+ processor *processing.Processor
storage *storage.Driver
oauthServer oauth.Server
diff --git a/internal/api/wellknown/webfinger/webfingerget.go b/internal/api/wellknown/webfinger/webfingerget.go
index 8c0d92e23..60bc316b1 100644
--- a/internal/api/wellknown/webfinger/webfingerget.go
+++ b/internal/api/wellknown/webfinger/webfingerget.go
@@ -81,7 +81,7 @@ func (m *Module) WebfingerGETRequest(c *gin.Context) {
return
}
- resp, errWithCode := m.processor.GetWebfingerAccount(c.Request.Context(), requestedUsername)
+ resp, errWithCode := m.processor.Fedi().WebfingerGet(c.Request.Context(), requestedUsername)
if errWithCode != nil {
apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGetV1)
return