mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-01 23:32:24 -05:00
parent
0846b76e93
commit
3e4e57d554
4 changed files with 157 additions and 0 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue