mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-01 04:32:24 -05:00
parent
0846b76e93
commit
3e4e57d554
4 changed files with 157 additions and 0 deletions
|
|
@ -46,6 +46,11 @@ func (p *processor) BlockCreate(ctx context.Context, requestingAccount *gtsmodel
|
|||
return p.RelationshipGet(ctx, requestingAccount, targetAccountID)
|
||||
}
|
||||
|
||||
// don't block yourself, silly
|
||||
if requestingAccount.ID == targetAccountID {
|
||||
return nil, gtserror.NewErrorNotAcceptable(fmt.Errorf("BlockCreate: account %s cannot block itself", requestingAccount.ID))
|
||||
}
|
||||
|
||||
// make the block
|
||||
block := >smodel.Block{}
|
||||
newBlockID, err := id.NewULID()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue