Move a lot of stuff + tidy stuff (#37)
Lots of renaming and moving stuff, some bug fixes, more lenient parsing of notifications and home timeline.
This commit is contained in:
@ -26,7 +26,7 @@ import (
|
||||
"github.com/sirupsen/logrus"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/api"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/config"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/message"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/processing"
|
||||
|
||||
"github.com/superseriousbusiness/gotosocial/internal/router"
|
||||
)
|
||||
@ -61,7 +61,7 @@ const (
|
||||
GetFollowingPath = BasePathWithID + "/following"
|
||||
// GetRelationshipsPath is for showing an account's relationship with other accounts
|
||||
GetRelationshipsPath = BasePath + "/relationships"
|
||||
// FollowPath is for POSTing new follows to, and updating existing follows
|
||||
// PostFollowPath is for POSTing new follows to, and updating existing follows
|
||||
PostFollowPath = BasePathWithID + "/follow"
|
||||
// PostUnfollowPath is for POSTing an unfollow
|
||||
PostUnfollowPath = BasePathWithID + "/unfollow"
|
||||
@ -70,12 +70,12 @@ const (
|
||||
// Module implements the ClientAPIModule interface for account-related actions
|
||||
type Module struct {
|
||||
config *config.Config
|
||||
processor message.Processor
|
||||
processor processing.Processor
|
||||
log *logrus.Logger
|
||||
}
|
||||
|
||||
// New returns a new account module
|
||||
func New(config *config.Config, processor message.Processor, log *logrus.Logger) api.ClientModule {
|
||||
func New(config *config.Config, processor processing.Processor, log *logrus.Logger) api.ClientModule {
|
||||
return &Module{
|
||||
config: config,
|
||||
processor: processor,
|
||||
|
@ -4,13 +4,13 @@ import (
|
||||
"github.com/sirupsen/logrus"
|
||||
"github.com/stretchr/testify/suite"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/api/client/account"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/blob"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/config"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/db"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/federation"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/gtsmodel"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/message"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/oauth"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/storage"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/processing"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/typeutils"
|
||||
)
|
||||
|
||||
@ -22,9 +22,9 @@ type AccountStandardTestSuite struct {
|
||||
db db.DB
|
||||
log *logrus.Logger
|
||||
tc typeutils.TypeConverter
|
||||
storage storage.Storage
|
||||
storage blob.Storage
|
||||
federator federation.Federator
|
||||
processor message.Processor
|
||||
processor processing.Processor
|
||||
|
||||
// standard suite models
|
||||
testTokens map[string]*oauth.Token
|
||||
|
@ -25,7 +25,7 @@ import (
|
||||
"github.com/superseriousbusiness/gotosocial/internal/oauth"
|
||||
)
|
||||
|
||||
// AccountFollowersGETHandler serves the followers of the requested account, if they're visible to the requester.
|
||||
// AccountFollowingGETHandler serves the following of the requested account, if they're visible to the requester.
|
||||
func (m *Module) AccountFollowingGETHandler(c *gin.Context) {
|
||||
authed, err := oauth.Authed(c, true, true, true, true)
|
||||
if err != nil {
|
||||
|
@ -24,7 +24,7 @@ import (
|
||||
"github.com/sirupsen/logrus"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/api"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/config"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/message"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/processing"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/router"
|
||||
)
|
||||
|
||||
@ -38,12 +38,12 @@ const (
|
||||
// Module implements the ClientAPIModule interface for admin-related actions (reports, emojis, etc)
|
||||
type Module struct {
|
||||
config *config.Config
|
||||
processor message.Processor
|
||||
processor processing.Processor
|
||||
log *logrus.Logger
|
||||
}
|
||||
|
||||
// New returns a new admin module
|
||||
func New(config *config.Config, processor message.Processor, log *logrus.Logger) api.ClientModule {
|
||||
func New(config *config.Config, processor processing.Processor, log *logrus.Logger) api.ClientModule {
|
||||
return &Module{
|
||||
config: config,
|
||||
processor: processor,
|
||||
|
@ -24,7 +24,7 @@ import (
|
||||
"github.com/sirupsen/logrus"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/api"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/config"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/message"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/processing"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/router"
|
||||
)
|
||||
|
||||
@ -34,12 +34,12 @@ const BasePath = "/api/v1/apps"
|
||||
// Module implements the ClientAPIModule interface for requests relating to registering/removing applications
|
||||
type Module struct {
|
||||
config *config.Config
|
||||
processor message.Processor
|
||||
processor processing.Processor
|
||||
log *logrus.Logger
|
||||
}
|
||||
|
||||
// New returns a new auth module
|
||||
func New(config *config.Config, processor message.Processor, log *logrus.Logger) api.ClientModule {
|
||||
func New(config *config.Config, processor processing.Processor, log *logrus.Logger) api.ClientModule {
|
||||
return &Module{
|
||||
config: config,
|
||||
processor: processor,
|
||||
|
@ -27,7 +27,7 @@ import (
|
||||
"github.com/superseriousbusiness/gotosocial/internal/config"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/db"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/gtsmodel"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/message"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/processing"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/router"
|
||||
)
|
||||
|
||||
@ -46,13 +46,13 @@ const (
|
||||
// The goal here is to serve requested media files if the gotosocial server is configured to use local storage.
|
||||
type FileServer struct {
|
||||
config *config.Config
|
||||
processor message.Processor
|
||||
processor processing.Processor
|
||||
log *logrus.Logger
|
||||
storageBase string
|
||||
}
|
||||
|
||||
// New returns a new fileServer module
|
||||
func New(config *config.Config, processor message.Processor, log *logrus.Logger) api.ClientModule {
|
||||
func New(config *config.Config, processor processing.Processor, log *logrus.Logger) api.ClientModule {
|
||||
return &FileServer{
|
||||
config: config,
|
||||
processor: processor,
|
||||
|
@ -31,14 +31,14 @@ import (
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/suite"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/api/client/fileserver"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/blob"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/config"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/db"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/federation"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/gtsmodel"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/media"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/message"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/oauth"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/storage"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/processing"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/typeutils"
|
||||
"github.com/superseriousbusiness/gotosocial/testrig"
|
||||
)
|
||||
@ -49,10 +49,10 @@ type ServeFileTestSuite struct {
|
||||
config *config.Config
|
||||
db db.DB
|
||||
log *logrus.Logger
|
||||
storage storage.Storage
|
||||
storage blob.Storage
|
||||
federator federation.Federator
|
||||
tc typeutils.TypeConverter
|
||||
processor message.Processor
|
||||
processor processing.Processor
|
||||
mediaHandler media.Handler
|
||||
oauthServer oauth.Server
|
||||
|
||||
|
@ -24,7 +24,7 @@ import (
|
||||
"github.com/sirupsen/logrus"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/api"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/config"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/message"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/processing"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/router"
|
||||
)
|
||||
|
||||
@ -46,12 +46,12 @@ const (
|
||||
// Module implements the ClientAPIModule interface for every related to interacting with follow requests
|
||||
type Module struct {
|
||||
config *config.Config
|
||||
processor message.Processor
|
||||
processor processing.Processor
|
||||
log *logrus.Logger
|
||||
}
|
||||
|
||||
// New returns a new follow request module
|
||||
func New(config *config.Config, processor message.Processor, log *logrus.Logger) api.ClientModule {
|
||||
func New(config *config.Config, processor processing.Processor, log *logrus.Logger) api.ClientModule {
|
||||
return &Module{
|
||||
config: config,
|
||||
processor: processor,
|
||||
|
@ -6,7 +6,7 @@ import (
|
||||
"github.com/sirupsen/logrus"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/api"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/config"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/message"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/processing"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/router"
|
||||
)
|
||||
|
||||
@ -18,12 +18,12 @@ const (
|
||||
// Module implements the ClientModule interface
|
||||
type Module struct {
|
||||
config *config.Config
|
||||
processor message.Processor
|
||||
processor processing.Processor
|
||||
log *logrus.Logger
|
||||
}
|
||||
|
||||
// New returns a new instance information module
|
||||
func New(config *config.Config, processor message.Processor, log *logrus.Logger) api.ClientModule {
|
||||
func New(config *config.Config, processor processing.Processor, log *logrus.Logger) api.ClientModule {
|
||||
return &Module{
|
||||
config: config,
|
||||
processor: processor,
|
||||
|
@ -27,7 +27,7 @@ import (
|
||||
"github.com/superseriousbusiness/gotosocial/internal/config"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/db"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/gtsmodel"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/message"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/processing"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/router"
|
||||
)
|
||||
|
||||
@ -43,12 +43,12 @@ const BasePathWithID = BasePath + "/:" + IDKey
|
||||
// Module implements the ClientAPIModule interface for media
|
||||
type Module struct {
|
||||
config *config.Config
|
||||
processor message.Processor
|
||||
processor processing.Processor
|
||||
log *logrus.Logger
|
||||
}
|
||||
|
||||
// New returns a new auth module
|
||||
func New(config *config.Config, processor message.Processor, log *logrus.Logger) api.ClientModule {
|
||||
func New(config *config.Config, processor processing.Processor, log *logrus.Logger) api.ClientModule {
|
||||
return &Module{
|
||||
config: config,
|
||||
processor: processor,
|
||||
|
@ -34,14 +34,14 @@ import (
|
||||
"github.com/stretchr/testify/suite"
|
||||
mediamodule "github.com/superseriousbusiness/gotosocial/internal/api/client/media"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/api/model"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/blob"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/config"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/db"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/federation"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/gtsmodel"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/media"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/message"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/oauth"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/storage"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/processing"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/typeutils"
|
||||
"github.com/superseriousbusiness/gotosocial/testrig"
|
||||
)
|
||||
@ -52,12 +52,12 @@ type MediaCreateTestSuite struct {
|
||||
config *config.Config
|
||||
db db.DB
|
||||
log *logrus.Logger
|
||||
storage storage.Storage
|
||||
storage blob.Storage
|
||||
federator federation.Federator
|
||||
tc typeutils.TypeConverter
|
||||
mediaHandler media.Handler
|
||||
oauthServer oauth.Server
|
||||
processor message.Processor
|
||||
processor processing.Processor
|
||||
|
||||
// standard suite models
|
||||
testTokens map[string]*oauth.Token
|
||||
|
@ -24,7 +24,7 @@ import (
|
||||
"github.com/sirupsen/logrus"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/api"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/config"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/message"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/processing"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/router"
|
||||
)
|
||||
|
||||
@ -39,19 +39,19 @@ const (
|
||||
|
||||
// MaxIDKey is the url query for setting a max notification ID to return
|
||||
MaxIDKey = "max_id"
|
||||
// Limit key is for specifying maximum number of notifications to return.
|
||||
// LimitKey is for specifying maximum number of notifications to return.
|
||||
LimitKey = "limit"
|
||||
)
|
||||
|
||||
// Module implements the ClientAPIModule interface for every related to posting/deleting/interacting with notifications
|
||||
type Module struct {
|
||||
config *config.Config
|
||||
processor message.Processor
|
||||
processor processing.Processor
|
||||
log *logrus.Logger
|
||||
}
|
||||
|
||||
// New returns a new notification module
|
||||
func New(config *config.Config, processor message.Processor, log *logrus.Logger) api.ClientModule {
|
||||
func New(config *config.Config, processor processing.Processor, log *logrus.Logger) api.ClientModule {
|
||||
return &Module{
|
||||
config: config,
|
||||
processor: processor,
|
||||
|
@ -27,6 +27,7 @@ import (
|
||||
"github.com/superseriousbusiness/gotosocial/internal/oauth"
|
||||
)
|
||||
|
||||
// NotificationsGETHandler serves a list of notifications to the caller, with the desired query parameters
|
||||
func (m *Module) NotificationsGETHandler(c *gin.Context) {
|
||||
l := m.log.WithFields(logrus.Fields{
|
||||
"func": "NotificationsGETHandler",
|
||||
|
@ -24,12 +24,12 @@ import (
|
||||
"github.com/sirupsen/logrus"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/api"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/config"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/message"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/processing"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/router"
|
||||
)
|
||||
|
||||
const (
|
||||
// BasePath is the base path for serving v1 of the search API
|
||||
// BasePathV1 is the base path for serving v1 of the search API
|
||||
BasePathV1 = "/api/v1/search"
|
||||
|
||||
// BasePathV2 is the base path for serving v2 of the search API
|
||||
@ -67,12 +67,12 @@ const (
|
||||
// Module implements the ClientAPIModule interface for everything related to searching
|
||||
type Module struct {
|
||||
config *config.Config
|
||||
processor message.Processor
|
||||
processor processing.Processor
|
||||
log *logrus.Logger
|
||||
}
|
||||
|
||||
// New returns a new search module
|
||||
func New(config *config.Config, processor message.Processor, log *logrus.Logger) api.ClientModule {
|
||||
func New(config *config.Config, processor processing.Processor, log *logrus.Logger) api.ClientModule {
|
||||
return &Module{
|
||||
config: config,
|
||||
processor: processor,
|
||||
|
@ -26,7 +26,7 @@ import (
|
||||
"github.com/sirupsen/logrus"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/api"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/config"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/message"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/processing"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/router"
|
||||
)
|
||||
|
||||
@ -75,12 +75,12 @@ const (
|
||||
// Module implements the ClientAPIModule interface for every related to posting/deleting/interacting with statuses
|
||||
type Module struct {
|
||||
config *config.Config
|
||||
processor message.Processor
|
||||
processor processing.Processor
|
||||
log *logrus.Logger
|
||||
}
|
||||
|
||||
// New returns a new account module
|
||||
func New(config *config.Config, processor message.Processor, log *logrus.Logger) api.ClientModule {
|
||||
func New(config *config.Config, processor processing.Processor, log *logrus.Logger) api.ClientModule {
|
||||
return &Module{
|
||||
config: config,
|
||||
processor: processor,
|
||||
|
@ -22,13 +22,13 @@ import (
|
||||
"github.com/sirupsen/logrus"
|
||||
"github.com/stretchr/testify/suite"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/api/client/status"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/blob"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/config"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/db"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/federation"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/gtsmodel"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/message"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/oauth"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/storage"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/processing"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/typeutils"
|
||||
)
|
||||
|
||||
@ -41,8 +41,8 @@ type StatusStandardTestSuite struct {
|
||||
log *logrus.Logger
|
||||
tc typeutils.TypeConverter
|
||||
federator federation.Federator
|
||||
processor message.Processor
|
||||
storage storage.Storage
|
||||
processor processing.Processor
|
||||
storage blob.Storage
|
||||
|
||||
// standard suite models
|
||||
testTokens map[string]*oauth.Token
|
||||
|
@ -24,7 +24,7 @@ import (
|
||||
"github.com/sirupsen/logrus"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/api"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/config"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/message"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/processing"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/router"
|
||||
)
|
||||
|
||||
@ -39,7 +39,7 @@ const (
|
||||
SinceIDKey = "since_id"
|
||||
// MinIDKey is the url query for returning results immediately newer than the given ID
|
||||
MinIDKey = "min_id"
|
||||
// Limit key is for specifying maximum number of results to return.
|
||||
// LimitKey is for specifying maximum number of results to return.
|
||||
LimitKey = "limit"
|
||||
// LocalKey is for specifying whether only local statuses should be returned
|
||||
LocalKey = "local"
|
||||
@ -48,12 +48,12 @@ const (
|
||||
// Module implements the ClientAPIModule interface for everything relating to viewing timelines
|
||||
type Module struct {
|
||||
config *config.Config
|
||||
processor message.Processor
|
||||
processor processing.Processor
|
||||
log *logrus.Logger
|
||||
}
|
||||
|
||||
// New returns a new timeline module
|
||||
func New(config *config.Config, processor message.Processor, log *logrus.Logger) api.ClientModule {
|
||||
func New(config *config.Config, processor processing.Processor, log *logrus.Logger) api.ClientModule {
|
||||
return &Module{
|
||||
config: config,
|
||||
processor: processor,
|
||||
|
Reference in New Issue
Block a user