summaryrefslogtreecommitdiff
path: root/internal/processing/account/createfollow.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/processing/account/createfollow.go')
-rw-r--r--internal/processing/account/createfollow.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/internal/processing/account/createfollow.go b/internal/processing/account/createfollow.go
index cd2dcbd8c..49430b9fb 100644
--- a/internal/processing/account/createfollow.go
+++ b/internal/processing/account/createfollow.go
@@ -65,6 +65,11 @@ func (p *processor) FollowCreate(ctx context.Context, requestingAccount *gtsmode
return p.RelationshipGet(ctx, requestingAccount, form.ID)
}
+ // check for attempt to follow self
+ if requestingAccount.ID == targetAcct.ID {
+ return nil, gtserror.NewErrorNotAcceptable(fmt.Errorf("accountfollowcreate: account %s cannot follow itself", requestingAccount.ID))
+ }
+
// make the follow request
newFollowID, err := id.NewRandomULID()
if err != nil {