mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2024-10-31 22:40:01 +00:00
[chore/bugfix] Fix missing insertion of preapproved interaction requests (#3228)
This commit is contained in:
parent
f35c124d14
commit
da3fa2d4a2
1 changed files with 9 additions and 0 deletions
|
@ -274,6 +274,9 @@ func (p *fediAPI) CreateStatus(ctx context.Context, fMsg *messages.FromFediAPI)
|
||||||
URI: uris.GenerateURIForAccept(status.InReplyToAccount.Username, id),
|
URI: uris.GenerateURIForAccept(status.InReplyToAccount.Username, id),
|
||||||
AcceptedAt: time.Now(),
|
AcceptedAt: time.Now(),
|
||||||
}
|
}
|
||||||
|
if err := p.state.DB.PutInteractionRequest(ctx, approval); err != nil {
|
||||||
|
return gtserror.Newf("db error putting pre-approved interaction request: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
// Mark the status as now approved.
|
// Mark the status as now approved.
|
||||||
status.PendingApproval = util.Ptr(false)
|
status.PendingApproval = util.Ptr(false)
|
||||||
|
@ -469,6 +472,9 @@ func (p *fediAPI) CreateLike(ctx context.Context, fMsg *messages.FromFediAPI) er
|
||||||
URI: uris.GenerateURIForAccept(fave.TargetAccount.Username, id),
|
URI: uris.GenerateURIForAccept(fave.TargetAccount.Username, id),
|
||||||
AcceptedAt: time.Now(),
|
AcceptedAt: time.Now(),
|
||||||
}
|
}
|
||||||
|
if err := p.state.DB.PutInteractionRequest(ctx, approval); err != nil {
|
||||||
|
return gtserror.Newf("db error putting pre-approved interaction request: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
// Mark the fave itself as now approved.
|
// Mark the fave itself as now approved.
|
||||||
fave.PendingApproval = util.Ptr(false)
|
fave.PendingApproval = util.Ptr(false)
|
||||||
|
@ -573,6 +579,9 @@ func (p *fediAPI) CreateAnnounce(ctx context.Context, fMsg *messages.FromFediAPI
|
||||||
URI: uris.GenerateURIForAccept(boost.BoostOfAccount.Username, id),
|
URI: uris.GenerateURIForAccept(boost.BoostOfAccount.Username, id),
|
||||||
AcceptedAt: time.Now(),
|
AcceptedAt: time.Now(),
|
||||||
}
|
}
|
||||||
|
if err := p.state.DB.PutInteractionRequest(ctx, approval); err != nil {
|
||||||
|
return gtserror.Newf("db error putting pre-approved interaction request: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
// Mark the boost itself as now approved.
|
// Mark the boost itself as now approved.
|
||||||
boost.PendingApproval = util.Ptr(false)
|
boost.PendingApproval = util.Ptr(false)
|
||||||
|
|
Loading…
Reference in a new issue