mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-01 15:42:25 -05:00
send out poll votes as separate create activities given that no other AP servers support multiple objects in a single activity (#3582)
This commit is contained in:
parent
3cc50491c2
commit
d9f67efae5
3 changed files with 75 additions and 48 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue