Skip to content

Commit

Permalink
[chore/bugfix] Fix missing insertion of preapproved interaction reque…
Browse files Browse the repository at this point in the history
…sts (#3228)
  • Loading branch information
tsmethurst authored Aug 24, 2024
1 parent f35c124 commit da3fa2d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions internal/processing/workers/fromfediapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,9 @@ func (p *fediAPI) CreateStatus(ctx context.Context, fMsg *messages.FromFediAPI)
URI: uris.GenerateURIForAccept(status.InReplyToAccount.Username, id),
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.
status.PendingApproval = util.Ptr(false)
Expand Down Expand Up @@ -469,6 +472,9 @@ func (p *fediAPI) CreateLike(ctx context.Context, fMsg *messages.FromFediAPI) er
URI: uris.GenerateURIForAccept(fave.TargetAccount.Username, id),
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.
fave.PendingApproval = util.Ptr(false)
Expand Down Expand Up @@ -573,6 +579,9 @@ func (p *fediAPI) CreateAnnounce(ctx context.Context, fMsg *messages.FromFediAPI
URI: uris.GenerateURIForAccept(boost.BoostOfAccount.Username, id),
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.
boost.PendingApproval = util.Ptr(false)
Expand Down

0 comments on commit da3fa2d

Please sign in to comment.