mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-01 22:22:24 -05:00
[bugfix] Add Actor to outgoing poll vote Create; other fixes (#2384)
This commit is contained in:
parent
5c17ecd93a
commit
e4e0a5e3f6
6 changed files with 108 additions and 51 deletions
|
|
@ -194,14 +194,13 @@ func (f *federate) CreatePollVote(ctx context.Context, poll *gtsmodel.Poll, vote
|
|||
return err
|
||||
}
|
||||
|
||||
// Convert votes to AS PollOptionable implementing type.
|
||||
notes, err := f.converter.PollVoteToASOptions(ctx, vote)
|
||||
// Convert vote to AS Create with vote choices as Objects.
|
||||
create, err := f.converter.PollVoteToASCreate(ctx, vote)
|
||||
if err != nil {
|
||||
return gtserror.Newf("error converting to notes: %w", err)
|
||||
}
|
||||
|
||||
// Send a Create activity with PollOptionables via the Actor's outbox.
|
||||
create := typeutils.WrapPollOptionablesInCreate(notes...)
|
||||
// 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)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue