mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-02 19:12:26 -06:00
start messing about with worker functions etc
This commit is contained in:
parent
b6ff55662e
commit
060ef4149b
15 changed files with 649 additions and 119 deletions
|
|
@ -203,26 +203,23 @@ func (p *Processor) acceptAnnounce(
|
|||
ctx context.Context,
|
||||
req *gtsmodel.InteractionRequest,
|
||||
) gtserror.WithCode {
|
||||
// If the Announce is missing, that means it's
|
||||
// probably already been undone by someone,
|
||||
// so there's nothing to actually accept.
|
||||
if req.Reply == nil {
|
||||
err := gtserror.Newf("no Announce found for interaction request %s", req.ID)
|
||||
return gtserror.NewErrorNotFound(err)
|
||||
}
|
||||
|
||||
// Update the Announce.
|
||||
req.Announce.PendingApproval = util.Ptr(false)
|
||||
req.Announce.PreApproved = false
|
||||
req.Announce.ApprovedByURI = req.URI
|
||||
if err := p.state.DB.UpdateStatus(
|
||||
ctx,
|
||||
req.Announce,
|
||||
"pending_approval",
|
||||
"approved_by_uri",
|
||||
); err != nil {
|
||||
err := gtserror.Newf("db error updating status announce: %w", err)
|
||||
return gtserror.NewErrorInternalError(err)
|
||||
// If the Announce is set, that means it comes
|
||||
// from someone straight up sending the Announce
|
||||
// instead of AnnounceRequest, so we already have
|
||||
// the Announce in the db. We can update it now.
|
||||
if req.Announce != nil {
|
||||
req.Announce.PendingApproval = util.Ptr(false)
|
||||
req.Announce.PreApproved = false
|
||||
req.Announce.ApprovedByURI = req.URI
|
||||
if err := p.state.DB.UpdateStatus(
|
||||
ctx,
|
||||
req.Announce,
|
||||
"pending_approval",
|
||||
"approved_by_uri",
|
||||
); err != nil {
|
||||
err := gtserror.Newf("db error updating status announce: %w", err)
|
||||
return gtserror.NewErrorInternalError(err)
|
||||
}
|
||||
}
|
||||
|
||||
// Send the accepted request off through the
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue