summaryrefslogtreecommitdiff
path: root/internal/processing/status/boost.go
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2024-09-23 14:42:19 +0200
committerLibravatar GitHub <noreply@github.com>2024-09-23 14:42:19 +0200
commit1ce854358def5f04b7c3b73418ab56bb58512634 (patch)
tree94d827b90e435c88367d080f53b63ee2285905d6 /internal/processing/status/boost.go
parent[chore] add nometrics build tagging to metrics API endpoint (#3331) (diff)
downloadgotosocial-1ce854358def5f04b7c3b73418ab56bb58512634.tar.xz
[feature] Show info for pending replies, allow implicit accept of pending replies (#3322)
* [feature] Allow implicit accept of pending replies * update wording
Diffstat (limited to 'internal/processing/status/boost.go')
-rw-r--r--internal/processing/status/boost.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/internal/processing/status/boost.go b/internal/processing/status/boost.go
index 1b6e8bd47..0e09a8e7b 100644
--- a/internal/processing/status/boost.go
+++ b/internal/processing/status/boost.go
@@ -28,6 +28,7 @@ import (
"github.com/superseriousbusiness/gotosocial/internal/gtserror"
"github.com/superseriousbusiness/gotosocial/internal/gtsmodel"
"github.com/superseriousbusiness/gotosocial/internal/messages"
+ "github.com/superseriousbusiness/gotosocial/internal/util"
)
// BoostCreate processes the boost/reblog of target
@@ -138,6 +139,23 @@ func (p *Processor) BoostCreate(
Target: target.Account,
})
+ // If the boost target status replies to a status
+ // that we own, and has a pending interaction
+ // request, use the boost as an implicit accept.
+ implicitlyAccepted, errWithCode := p.implicitlyAccept(ctx,
+ requester, target,
+ )
+ if errWithCode != nil {
+ return nil, errWithCode
+ }
+
+ // If we ended up implicitly accepting, mark the
+ // target status as no longer pending approval so
+ // it's serialized properly via the API.
+ if implicitlyAccepted {
+ target.PendingApproval = util.Ptr(false)
+ }
+
return p.c.GetAPIStatus(ctx, requester, boost)
}