summaryrefslogtreecommitdiff
path: root/internal/processing/workers
diff options
context:
space:
mode:
authorLibravatar kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com>2024-11-28 15:37:37 +0000
committerLibravatar GitHub <noreply@github.com>2024-11-28 15:37:37 +0000
commitd9f67efae512673c826b27daeae404a6051d9817 (patch)
treefe89c62e3f43eb285d6ed64b2b407986fe1917bb /internal/processing/workers
parentpulls in the latest exif-terminator version with bugfix and performance optim... (diff)
downloadgotosocial-d9f67efae512673c826b27daeae404a6051d9817.tar.xz
send out poll votes as separate create activities given that no other AP servers support multiple objects in a single activity (#3582)
Diffstat (limited to 'internal/processing/workers')
-rw-r--r--internal/processing/workers/federate.go17
1 files changed, 11 insertions, 6 deletions
diff --git a/internal/processing/workers/federate.go b/internal/processing/workers/federate.go
index a0fd6bf69..8c08c42b7 100644
--- a/internal/processing/workers/federate.go
+++ b/internal/processing/workers/federate.go
@@ -217,18 +217,23 @@ func (f *federate) CreatePollVote(ctx context.Context, poll *gtsmodel.Poll, vote
return err
}
- // Convert vote to AS Create with vote choices as Objects.
- create, err := f.converter.PollVoteToASCreate(ctx, vote)
+ // Convert vote to AS Creates with vote choices as Objects.
+ creates, err := f.converter.PollVoteToASCreates(ctx, vote)
if err != nil {
return gtserror.Newf("error converting to notes: %w", err)
}
- // Send the Create via the Actor's outbox.
- if _, err := f.FederatingActor().Send(ctx, outboxIRI, create); err != nil {
- return gtserror.Newf("error sending Create activity via outbox %s: %w", outboxIRI, err)
+ var errs gtserror.MultiError
+
+ // Send each create activity.
+ actor := f.FederatingActor()
+ for _, create := range creates {
+ if _, err := actor.Send(ctx, outboxIRI, create); err != nil {
+ errs.Appendf("error sending Create activity via outbox %s: %w", outboxIRI, err)
+ }
}
- return nil
+ return errs.Combine()
}
func (f *federate) DeleteStatus(ctx context.Context, status *gtsmodel.Status) error {