summaryrefslogtreecommitdiff
path: root/internal/processing/account/createblock.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/processing/account/createblock.go')
-rw-r--r--internal/processing/account/createblock.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/internal/processing/account/createblock.go b/internal/processing/account/createblock.go
index e1bad0d38..dfe1475cb 100644
--- a/internal/processing/account/createblock.go
+++ b/internal/processing/account/createblock.go
@@ -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 := &gtsmodel.Block{}
newBlockID, err := id.NewULID()