mirror of
https://github.com/superseriousbusiness/gotosocial
synced 2025-06-05 21:59:39 +02:00
[feature] Serve bot accounts over AP as Service instead of Person (#3672)
* pepis * oopsie doopsie * bollocks
This commit is contained in:
@@ -21,7 +21,6 @@ import (
|
||||
"context"
|
||||
"net/url"
|
||||
|
||||
"github.com/superseriousbusiness/activity/pub"
|
||||
"github.com/superseriousbusiness/activity/streams"
|
||||
"github.com/superseriousbusiness/activity/streams/vocab"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/ap"
|
||||
@@ -93,11 +92,6 @@ func (f *federate) DeleteAccount(ctx context.Context, account *gtsmodel.Account)
|
||||
return err
|
||||
}
|
||||
|
||||
publicIRI, err := parseURI(pub.PublicActivityPubIRI)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// Create a new delete.
|
||||
// todo: tc.AccountToASDelete
|
||||
delete := streams.NewActivityStreamsDelete()
|
||||
@@ -121,7 +115,7 @@ func (f *federate) DeleteAccount(ctx context.Context, account *gtsmodel.Account)
|
||||
|
||||
// Address the delete CC public.
|
||||
deleteCC := streams.NewActivityStreamsCcProperty()
|
||||
deleteCC.AppendIRI(publicIRI)
|
||||
deleteCC.AppendIRI(ap.PublicURI())
|
||||
delete.SetActivityStreamsCc(deleteCC)
|
||||
|
||||
// Send the Delete via the Actor's outbox.
|
||||
@@ -877,14 +871,14 @@ func (f *federate) UpdateAccount(ctx context.Context, account *gtsmodel.Account)
|
||||
return err
|
||||
}
|
||||
|
||||
// Convert account to ActivityStreams Person.
|
||||
person, err := f.converter.AccountToAS(ctx, account)
|
||||
// Convert account to Accountable.
|
||||
accountable, err := f.converter.AccountToAS(ctx, account)
|
||||
if err != nil {
|
||||
return gtserror.Newf("error converting account to Person: %w", err)
|
||||
}
|
||||
|
||||
// Use ActivityStreams Person as Object of Update.
|
||||
update, err := f.converter.WrapPersonInUpdate(person, account)
|
||||
// Use Accountable as Object of Update.
|
||||
update, err := f.converter.WrapAccountableInUpdate(accountable)
|
||||
if err != nil {
|
||||
return gtserror.Newf("error wrapping Person in Update: %w", err)
|
||||
}
|
||||
@@ -1089,11 +1083,6 @@ func (f *federate) MoveAccount(ctx context.Context, account *gtsmodel.Account) e
|
||||
return err
|
||||
}
|
||||
|
||||
publicIRI, err := parseURI(pub.PublicActivityPubIRI)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// Create a new move.
|
||||
move := streams.NewActivityStreamsMove()
|
||||
|
||||
@@ -1115,7 +1104,7 @@ func (f *federate) MoveAccount(ctx context.Context, account *gtsmodel.Account) e
|
||||
ap.AppendTo(move, followersIRI)
|
||||
|
||||
// Address the move CC public.
|
||||
ap.AppendCc(move, publicIRI)
|
||||
ap.AppendCc(move, ap.PublicURI())
|
||||
|
||||
// Send the Move via the Actor's outbox.
|
||||
if _, err := f.FederatingActor().Send(
|
||||
|
Reference in New Issue
Block a user