From da3fa2d4a2e2c37dd0426ba674e922ef3648a3e9 Mon Sep 17 00:00:00 2001 From: tobi <31960611+tsmethurst@users.noreply.github.com> Date: Sat, 24 Aug 2024 14:17:55 +0200 Subject: [PATCH] [chore/bugfix] Fix missing insertion of preapproved interaction requests (#3228) --- internal/processing/workers/fromfediapi.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/internal/processing/workers/fromfediapi.go b/internal/processing/workers/fromfediapi.go index 908369ca6..42e5e9db2 100644 --- a/internal/processing/workers/fromfediapi.go +++ b/internal/processing/workers/fromfediapi.go @@ -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) @@ -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) @@ -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)