diff options
Diffstat (limited to 'internal/federation/dereferencing')
| -rw-r--r-- | internal/federation/dereferencing/account.go | 6 | ||||
| -rw-r--r-- | internal/federation/dereferencing/collectionpage.go | 3 | ||||
| -rw-r--r-- | internal/federation/dereferencing/status.go | 18 | ||||
| -rw-r--r-- | internal/federation/dereferencing/status_test.go | 5 | 
4 files changed, 16 insertions, 16 deletions
| diff --git a/internal/federation/dereferencing/account.go b/internal/federation/dereferencing/account.go index 8cae002e8..b16b53fee 100644 --- a/internal/federation/dereferencing/account.go +++ b/internal/federation/dereferencing/account.go @@ -165,19 +165,19 @@ func (d *deref) dereferenceAccountable(ctx context.Context, username string, rem  	}  	switch t.GetTypeName() { -	case string(gtsmodel.ActivityStreamsPerson): +	case ap.ActorPerson:  		p, ok := t.(vocab.ActivityStreamsPerson)  		if !ok {  			return nil, errors.New("DereferenceAccountable: error resolving type as activitystreams person")  		}  		return p, nil -	case string(gtsmodel.ActivityStreamsApplication): +	case ap.ActorApplication:  		p, ok := t.(vocab.ActivityStreamsApplication)  		if !ok {  			return nil, errors.New("DereferenceAccountable: error resolving type as activitystreams application")  		}  		return p, nil -	case string(gtsmodel.ActivityStreamsService): +	case ap.ActorService:  		p, ok := t.(vocab.ActivityStreamsService)  		if !ok {  			return nil, errors.New("DereferenceAccountable: error resolving type as activitystreams service") diff --git a/internal/federation/dereferencing/collectionpage.go b/internal/federation/dereferencing/collectionpage.go index 6f0beeaf6..c5a54402c 100644 --- a/internal/federation/dereferencing/collectionpage.go +++ b/internal/federation/dereferencing/collectionpage.go @@ -28,7 +28,6 @@ import (  	"github.com/go-fed/activity/streams"  	"github.com/go-fed/activity/streams/vocab"  	"github.com/superseriousbusiness/gotosocial/internal/ap" -	"github.com/superseriousbusiness/gotosocial/internal/gtsmodel"  )  // DereferenceCollectionPage returns the activitystreams CollectionPage at the specified IRI, or an error if something goes wrong. @@ -57,7 +56,7 @@ func (d *deref) DereferenceCollectionPage(ctx context.Context, username string,  		return nil, fmt.Errorf("DereferenceCollectionPage: error resolving json into ap vocab type: %s", err)  	} -	if t.GetTypeName() != gtsmodel.ActivityStreamsCollectionPage { +	if t.GetTypeName() != ap.ObjectCollectionPage {  		return nil, fmt.Errorf("DereferenceCollectionPage: type name %s not supported", t.GetTypeName())  	} diff --git a/internal/federation/dereferencing/status.go b/internal/federation/dereferencing/status.go index 7a7f928f1..b8f5bba3b 100644 --- a/internal/federation/dereferencing/status.go +++ b/internal/federation/dereferencing/status.go @@ -154,55 +154,55 @@ func (d *deref) dereferenceStatusable(ctx context.Context, username string, remo  	// Article, Document, Image, Video, Note, Page, Event, Place, Mention, Profile  	switch t.GetTypeName() { -	case gtsmodel.ActivityStreamsArticle: +	case ap.ObjectArticle:  		p, ok := t.(vocab.ActivityStreamsArticle)  		if !ok {  			return nil, errors.New("DereferenceStatusable: error resolving type as ActivityStreamsArticle")  		}  		return p, nil -	case gtsmodel.ActivityStreamsDocument: +	case ap.ObjectDocument:  		p, ok := t.(vocab.ActivityStreamsDocument)  		if !ok {  			return nil, errors.New("DereferenceStatusable: error resolving type as ActivityStreamsDocument")  		}  		return p, nil -	case gtsmodel.ActivityStreamsImage: +	case ap.ObjectImage:  		p, ok := t.(vocab.ActivityStreamsImage)  		if !ok {  			return nil, errors.New("DereferenceStatusable: error resolving type as ActivityStreamsImage")  		}  		return p, nil -	case gtsmodel.ActivityStreamsVideo: +	case ap.ObjectVideo:  		p, ok := t.(vocab.ActivityStreamsVideo)  		if !ok {  			return nil, errors.New("DereferenceStatusable: error resolving type as ActivityStreamsVideo")  		}  		return p, nil -	case gtsmodel.ActivityStreamsNote: +	case ap.ObjectNote:  		p, ok := t.(vocab.ActivityStreamsNote)  		if !ok {  			return nil, errors.New("DereferenceStatusable: error resolving type as ActivityStreamsNote")  		}  		return p, nil -	case gtsmodel.ActivityStreamsPage: +	case ap.ObjectPage:  		p, ok := t.(vocab.ActivityStreamsPage)  		if !ok {  			return nil, errors.New("DereferenceStatusable: error resolving type as ActivityStreamsPage")  		}  		return p, nil -	case gtsmodel.ActivityStreamsEvent: +	case ap.ObjectEvent:  		p, ok := t.(vocab.ActivityStreamsEvent)  		if !ok {  			return nil, errors.New("DereferenceStatusable: error resolving type as ActivityStreamsEvent")  		}  		return p, nil -	case gtsmodel.ActivityStreamsPlace: +	case ap.ObjectPlace:  		p, ok := t.(vocab.ActivityStreamsPlace)  		if !ok {  			return nil, errors.New("DereferenceStatusable: error resolving type as ActivityStreamsPlace")  		}  		return p, nil -	case gtsmodel.ActivityStreamsProfile: +	case ap.ObjectProfile:  		p, ok := t.(vocab.ActivityStreamsProfile)  		if !ok {  			return nil, errors.New("DereferenceStatusable: error resolving type as ActivityStreamsProfile") diff --git a/internal/federation/dereferencing/status_test.go b/internal/federation/dereferencing/status_test.go index 43732ac77..1ab4ade53 100644 --- a/internal/federation/dereferencing/status_test.go +++ b/internal/federation/dereferencing/status_test.go @@ -29,6 +29,7 @@ import (  	"github.com/go-fed/activity/streams"  	"github.com/stretchr/testify/suite" +	"github.com/superseriousbusiness/gotosocial/internal/ap"  	"github.com/superseriousbusiness/gotosocial/internal/db"  	"github.com/superseriousbusiness/gotosocial/internal/federation/dereferencing"  	"github.com/superseriousbusiness/gotosocial/internal/gtsmodel" @@ -133,7 +134,7 @@ func (suite *StatusTestSuite) TestDereferenceSimpleStatus() {  	suite.False(status.Local)  	suite.Empty(status.ContentWarning)  	suite.Equal(gtsmodel.VisibilityPublic, status.Visibility) -	suite.Equal(gtsmodel.ActivityStreamsNote, status.ActivityStreamsType) +	suite.Equal(ap.ObjectNote, status.ActivityStreamsType)  	// status should be in the database  	dbStatus, err := suite.db.GetStatusByURI(context.Background(), status.URI) @@ -171,7 +172,7 @@ func (suite *StatusTestSuite) TestDereferenceStatusWithMention() {  	suite.False(status.Local)  	suite.Empty(status.ContentWarning)  	suite.Equal(gtsmodel.VisibilityPublic, status.Visibility) -	suite.Equal(gtsmodel.ActivityStreamsNote, status.ActivityStreamsType) +	suite.Equal(ap.ObjectNote, status.ActivityStreamsType)  	// status should be in the database  	dbStatus, err := suite.db.GetStatusByURI(context.Background(), status.URI) | 
