summaryrefslogtreecommitdiff
path: root/internal/api/s2s
diff options
context:
space:
mode:
authorLibravatar Tobi Smethurst <31960611+tsmethurst@users.noreply.github.com>2021-05-30 13:12:00 +0200
committerLibravatar GitHub <noreply@github.com>2021-05-30 13:12:00 +0200
commit3d77f81c7fed002c628db82d822cc46c56a57e64 (patch)
treeba6eea80246fc2b1466ccc1435f50a3f63fd02df /internal/api/s2s
parentfix some lil bugs in search (diff)
downloadgotosocial-3d77f81c7fed002c628db82d822cc46c56a57e64.tar.xz
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.
Diffstat (limited to 'internal/api/s2s')
-rw-r--r--internal/api/s2s/user/followers.go1
-rw-r--r--internal/api/s2s/user/following.go1
-rw-r--r--internal/api/s2s/user/inboxpost.go4
-rw-r--r--internal/api/s2s/user/statusget.go1
-rw-r--r--internal/api/s2s/user/user.go6
-rw-r--r--internal/api/s2s/user/user_test.go8
-rw-r--r--internal/api/s2s/webfinger/webfinger.go6
7 files changed, 15 insertions, 12 deletions
diff --git a/internal/api/s2s/user/followers.go b/internal/api/s2s/user/followers.go
index 0b633619f..9ccf9c4d5 100644
--- a/internal/api/s2s/user/followers.go
+++ b/internal/api/s2s/user/followers.go
@@ -25,6 +25,7 @@ import (
"github.com/sirupsen/logrus"
)
+// FollowersGETHandler returns a collection of URIs for followers of the target user, formatted so that other AP servers can understand it.
func (m *Module) FollowersGETHandler(c *gin.Context) {
l := m.log.WithFields(logrus.Fields{
"func": "FollowersGETHandler",
diff --git a/internal/api/s2s/user/following.go b/internal/api/s2s/user/following.go
index de5701f8d..f19965c26 100644
--- a/internal/api/s2s/user/following.go
+++ b/internal/api/s2s/user/following.go
@@ -25,6 +25,7 @@ import (
"github.com/sirupsen/logrus"
)
+// FollowingGETHandler returns a collection of URIs for accounts that the target user follows, formatted so that other AP servers can understand it.
func (m *Module) FollowingGETHandler(c *gin.Context) {
l := m.log.WithFields(logrus.Fields{
"func": "FollowingGETHandler",
diff --git a/internal/api/s2s/user/inboxpost.go b/internal/api/s2s/user/inboxpost.go
index 60b74ab70..642ba6498 100644
--- a/internal/api/s2s/user/inboxpost.go
+++ b/internal/api/s2s/user/inboxpost.go
@@ -23,7 +23,7 @@ import (
"github.com/gin-gonic/gin"
"github.com/sirupsen/logrus"
- "github.com/superseriousbusiness/gotosocial/internal/message"
+ "github.com/superseriousbusiness/gotosocial/internal/processing"
)
// InboxPOSTHandler deals with incoming POST requests to an actor's inbox.
@@ -42,7 +42,7 @@ func (m *Module) InboxPOSTHandler(c *gin.Context) {
posted, err := m.processor.InboxPost(c.Request.Context(), c.Writer, c.Request)
if err != nil {
- if withCode, ok := err.(message.ErrorWithCode); ok {
+ if withCode, ok := err.(processing.ErrorWithCode); ok {
l.Debug(withCode.Error())
c.JSON(withCode.Code(), withCode.Safe())
return
diff --git a/internal/api/s2s/user/statusget.go b/internal/api/s2s/user/statusget.go
index 60efd484e..22774ae2c 100644
--- a/internal/api/s2s/user/statusget.go
+++ b/internal/api/s2s/user/statusget.go
@@ -7,6 +7,7 @@ import (
"github.com/sirupsen/logrus"
)
+// StatusGETHandler serves the target status as an activitystreams NOTE so that other AP servers can parse it.
func (m *Module) StatusGETHandler(c *gin.Context) {
l := m.log.WithFields(logrus.Fields{
"func": "StatusGETHandler",
diff --git a/internal/api/s2s/user/user.go b/internal/api/s2s/user/user.go
index e1bdb9a8d..ffb308038 100644
--- a/internal/api/s2s/user/user.go
+++ b/internal/api/s2s/user/user.go
@@ -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"
"github.com/superseriousbusiness/gotosocial/internal/util"
)
@@ -60,12 +60,12 @@ var ActivityPubAcceptHeaders = []string{
// Module implements the FederationAPIModule interface
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.FederationModule {
+func New(config *config.Config, processor processing.Processor, log *logrus.Logger) api.FederationModule {
return &Module{
config: config,
processor: processor,
diff --git a/internal/api/s2s/user/user_test.go b/internal/api/s2s/user/user_test.go
index 84e35ab68..91d1ea32d 100644
--- a/internal/api/s2s/user/user_test.go
+++ b/internal/api/s2s/user/user_test.go
@@ -4,13 +4,13 @@ import (
"github.com/sirupsen/logrus"
"github.com/stretchr/testify/suite"
"github.com/superseriousbusiness/gotosocial/internal/api/s2s/user"
+ "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"
)
@@ -23,8 +23,8 @@ type UserStandardTestSuite 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
diff --git a/internal/api/s2s/webfinger/webfinger.go b/internal/api/s2s/webfinger/webfinger.go
index 168fe1e76..6d48dc80a 100644
--- a/internal/api/s2s/webfinger/webfinger.go
+++ b/internal/api/s2s/webfinger/webfinger.go
@@ -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"
)
@@ -36,12 +36,12 @@ const (
// Module implements the FederationModule interface
type Module struct {
config *config.Config
- processor message.Processor
+ processor processing.Processor
log *logrus.Logger
}
// New returns a new webfinger module
-func New(config *config.Config, processor message.Processor, log *logrus.Logger) api.FederationModule {
+func New(config *config.Config, processor processing.Processor, log *logrus.Logger) api.FederationModule {
return &Module{
config: config,
processor: processor,