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.go12
1 files changed, 7 insertions, 5 deletions
diff --git a/internal/federation/federatingdb/announce.go b/internal/federation/federatingdb/announce.go
index 322a4838f..a70c0c3a6 100644
--- a/internal/federation/federatingdb/announce.go
+++ b/internal/federation/federatingdb/announce.go
@@ -31,29 +31,31 @@ func (f *federatingDB) Announce(ctx context.Context, announce vocab.ActivityStre
targetAcctI := ctx.Value(util.APAccount)
if targetAcctI == nil {
- l.Error("target account wasn't set on context")
+ // If the target account 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
}
targetAcct, ok := targetAcctI.(*gtsmodel.Account)
if !ok {
- l.Error("target account was set on context but couldn't be parsed")
+ l.Error("ANNOUNCE: target account was set on context but couldn't be parsed")
return nil
}
fromFederatorChanI := ctx.Value(util.APFromFederatorChanKey)
if fromFederatorChanI == nil {
- l.Error("from federator channel wasn't set on context")
+ l.Error("ANNOUNCE: from federator channel wasn't set on context")
return nil
}
fromFederatorChan, ok := fromFederatorChanI.(chan gtsmodel.FromFederator)
if !ok {
- l.Error("from federator channel was set on context but couldn't be parsed")
+ l.Error("ANNOUNCE: from federator channel was set on context but couldn't be parsed")
return nil
}
boost, isNew, err := f.typeConverter.ASAnnounceToStatus(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 {