mirror of
https://github.com/superseriousbusiness/gotosocial
synced 2025-06-05 21:59:39 +02:00
[bugfix] Ensure id set on outgoing Reject + Accept (#3312)
This commit is contained in:
@ -1149,41 +1149,18 @@ func (f *federate) AcceptInteraction(
|
||||
return nil
|
||||
}
|
||||
|
||||
// Parse relevant URI(s).
|
||||
// Parse outbox URI.
|
||||
outboxIRI, err := parseURI(req.TargetAccount.OutboxURI)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
acceptingAcctIRI, err := parseURI(req.TargetAccount.URI)
|
||||
// Convert req to Accept.
|
||||
accept, err := f.converter.InteractionReqToASAccept(ctx, req)
|
||||
if err != nil {
|
||||
return err
|
||||
return gtserror.Newf("error converting request to Accept: %w", err)
|
||||
}
|
||||
|
||||
interactingAcctURI, err := parseURI(req.InteractingAccount.URI)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
interactionURI, err := parseURI(req.InteractionURI)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// Create a new Accept.
|
||||
accept := streams.NewActivityStreamsAccept()
|
||||
|
||||
// Set interacted-with account
|
||||
// as Actor of the Accept.
|
||||
ap.AppendActorIRIs(accept, acceptingAcctIRI)
|
||||
|
||||
// Set the interacted-with object
|
||||
// as Object of the Accept.
|
||||
ap.AppendObjectIRIs(accept, interactionURI)
|
||||
|
||||
// Address the Accept To the interacting acct.
|
||||
ap.AppendTo(accept, interactingAcctURI)
|
||||
|
||||
// Send the Accept via the Actor's outbox.
|
||||
if _, err := f.FederatingActor().Send(
|
||||
ctx, outboxIRI, accept,
|
||||
@ -1221,41 +1198,18 @@ func (f *federate) RejectInteraction(
|
||||
return nil
|
||||
}
|
||||
|
||||
// Parse relevant URI(s).
|
||||
// Parse outbox URI.
|
||||
outboxIRI, err := parseURI(req.TargetAccount.OutboxURI)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
rejectingAcctIRI, err := parseURI(req.TargetAccount.URI)
|
||||
// Convert req to Reject.
|
||||
reject, err := f.converter.InteractionReqToASReject(ctx, req)
|
||||
if err != nil {
|
||||
return err
|
||||
return gtserror.Newf("error converting request to Reject: %w", err)
|
||||
}
|
||||
|
||||
interactingAcctURI, err := parseURI(req.InteractingAccount.URI)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
interactionURI, err := parseURI(req.InteractionURI)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// Create a new Reject.
|
||||
reject := streams.NewActivityStreamsReject()
|
||||
|
||||
// Set interacted-with account
|
||||
// as Actor of the Reject.
|
||||
ap.AppendActorIRIs(reject, rejectingAcctIRI)
|
||||
|
||||
// Set the interacted-with object
|
||||
// as Object of the Reject.
|
||||
ap.AppendObjectIRIs(reject, interactionURI)
|
||||
|
||||
// Address the Reject To the interacting acct.
|
||||
ap.AppendTo(reject, interactingAcctURI)
|
||||
|
||||
// Send the Reject via the Actor's outbox.
|
||||
if _, err := f.FederatingActor().Send(
|
||||
ctx, outboxIRI, reject,
|
||||
|
Reference in New Issue
Block a user