mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-01-28 03:26:36 +01:00
Forbid mentioning others in backfills
This commit is contained in:
parent
a83e4fb7cb
commit
1e9646596b
1 changed files with 13 additions and 1 deletions
|
@ -161,6 +161,18 @@ func (p *Processor) Create(
|
||||||
PendingApproval: util.Ptr(false),
|
PendingApproval: util.Ptr(false),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if backfill {
|
||||||
|
log.Infof(ctx, "%d mentions", len(status.Mentions))
|
||||||
|
for _, mention := range status.Mentions {
|
||||||
|
log.Infof(ctx, "mention: target account ID = %s, requester ID = %s", mention.TargetAccountID, requester.ID)
|
||||||
|
if mention.TargetAccountID != requester.ID {
|
||||||
|
const errText = "statuses mentioning others can't be backfilled"
|
||||||
|
err := gtserror.New(errText)
|
||||||
|
return nil, gtserror.NewErrorBadRequest(err, errText)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Check + attach in-reply-to status.
|
// Check + attach in-reply-to status.
|
||||||
if errWithCode := p.processInReplyTo(ctx,
|
if errWithCode := p.processInReplyTo(ctx,
|
||||||
requester,
|
requester,
|
||||||
|
@ -194,7 +206,7 @@ func (p *Processor) Create(
|
||||||
|
|
||||||
if form.Poll != nil {
|
if form.Poll != nil {
|
||||||
if backfill {
|
if backfill {
|
||||||
const errText = "posts with polls can't be backfilled"
|
const errText = "statuses with polls can't be backfilled"
|
||||||
err := gtserror.New(errText)
|
err := gtserror.New(errText)
|
||||||
return nil, gtserror.NewErrorBadRequest(err, errText)
|
return nil, gtserror.NewErrorBadRequest(err, errText)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue