summaryrefslogtreecommitdiff
path: root/internal/processing/fromclientapi.go
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2023-03-03 20:56:34 +0100
committerLibravatar GitHub <noreply@github.com>2023-03-03 19:56:34 +0000
commit5be59f4a25b85f78396464fade6e069bfc26ed1b (patch)
tree9a71e79a426877802043ee1f86a4b86b9d8b2e92 /internal/processing/fromclientapi.go
parent[bugfix] Clamp admin report limit <1 to 100 (#1583) (diff)
downloadgotosocial-5be59f4a25b85f78396464fade6e069bfc26ed1b.tar.xz
[bugfix] Federate status delete using just the URI (#1584)
Diffstat (limited to 'internal/processing/fromclientapi.go')
-rw-r--r--internal/processing/fromclientapi.go28
1 files changed, 3 insertions, 25 deletions
diff --git a/internal/processing/fromclientapi.go b/internal/processing/fromclientapi.go
index 209a27105..0d330ed3d 100644
--- a/internal/processing/fromclientapi.go
+++ b/internal/processing/fromclientapi.go
@@ -467,38 +467,16 @@ func (p *Processor) federateStatusDelete(ctx context.Context, status *gtsmodel.S
return nil
}
- asStatus, err := p.tc.StatusToAS(ctx, status)
+ delete, err := p.tc.StatusToASDelete(ctx, status)
if err != nil {
- return fmt.Errorf("federateStatusDelete: error converting status to as format: %s", err)
+ return fmt.Errorf("federateStatusDelete: error creating Delete: %w", err)
}
outboxIRI, err := url.Parse(status.Account.OutboxURI)
if err != nil {
- return fmt.Errorf("federateStatusDelete: error parsing outboxURI %s: %s", status.Account.OutboxURI, err)
- }
-
- actorIRI, err := url.Parse(status.Account.URI)
- if err != nil {
- return fmt.Errorf("federateStatusDelete: error parsing actorIRI %s: %s", status.Account.URI, err)
+ return fmt.Errorf("federateStatusDelete: error parsing outboxURI %s: %w", status.Account.OutboxURI, err)
}
- // create a delete and set the appropriate actor on it
- delete := streams.NewActivityStreamsDelete()
-
- // set the actor for the delete
- deleteActor := streams.NewActivityStreamsActorProperty()
- deleteActor.AppendIRI(actorIRI)
- delete.SetActivityStreamsActor(deleteActor)
-
- // Set the status as the 'object' property.
- deleteObject := streams.NewActivityStreamsObjectProperty()
- deleteObject.AppendActivityStreamsNote(asStatus)
- delete.SetActivityStreamsObject(deleteObject)
-
- // set the to and cc as the original to/cc of the original status
- delete.SetActivityStreamsTo(asStatus.GetActivityStreamsTo())
- delete.SetActivityStreamsCc(asStatus.GetActivityStreamsCc())
-
_, err = p.federator.FederatingActor().Send(ctx, outboxIRI, delete)
return err
}