summaryrefslogtreecommitdiff
path: root/internal/federation/federatingdb/announce.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/federation/federatingdb/announce.go')
-rw-r--r--internal/federation/federatingdb/announce.go13
1 files changed, 5 insertions, 8 deletions
diff --git a/internal/federation/federatingdb/announce.go b/internal/federation/federatingdb/announce.go
index 9a03ede92..49ec84509 100644
--- a/internal/federation/federatingdb/announce.go
+++ b/internal/federation/federatingdb/announce.go
@@ -44,12 +44,9 @@ func (f *federatingDB) Announce(ctx context.Context, announce vocab.ActivityStre
l.Debug("entering Announce")
}
- targetAcct, fromFederatorChan, err := extractFromCtx(ctx)
- if err != nil {
- return err
- }
- if targetAcct == nil || fromFederatorChan == nil {
- // If the target account or federator channel wasn't set on the context, that means this request didn't pass
+ receivingAccount, _, fromFederatorChan := extractFromCtx(ctx)
+ if receivingAccount == nil || fromFederatorChan == nil {
+ // If the receiving account or federator channel wasn't set on the context, that means this request didn't pass
// through the API, but came from inside GtS as the result of another activity on this instance. That being so,
// we can safely just ignore this activity, since we know we've already processed it elsewhere.
return nil
@@ -57,7 +54,7 @@ func (f *federatingDB) Announce(ctx context.Context, announce vocab.ActivityStre
boost, isNew, err := f.typeConverter.ASAnnounceToStatus(ctx, announce)
if err != nil {
- return fmt.Errorf("ANNOUNCE: error converting announce to boost: %s", err)
+ return fmt.Errorf("Announce: error converting announce to boost: %s", err)
}
if !isNew {
@@ -70,7 +67,7 @@ func (f *federatingDB) Announce(ctx context.Context, announce vocab.ActivityStre
APObjectType: ap.ActivityAnnounce,
APActivityType: ap.ActivityCreate,
GTSModel: boost,
- ReceivingAccount: targetAcct,
+ ReceivingAccount: receivingAccount,
}
return nil