summaryrefslogtreecommitdiff
path: root/internal/federation/federatingdb/announce.go
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2023-06-17 17:49:11 +0200
committerLibravatar GitHub <noreply@github.com>2023-06-17 16:49:11 +0100
commitd8e16a226a570a7d262bdeb067273ce35b03cc7c (patch)
tree94a09ebe5501c01159efb8aa3e74d70da8db2f87 /internal/federation/federatingdb/announce.go
parent[bugfix] Accept non-multipart forms for account updates (#1896) (diff)
downloadgotosocial-d8e16a226a570a7d262bdeb067273ce35b03cc7c.tar.xz
[chore/bugfix] Refactor `ap/extract.go` functions, return URIs more reliably (#1897)
Diffstat (limited to 'internal/federation/federatingdb/announce.go')
-rw-r--r--internal/federation/federatingdb/announce.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/internal/federation/federatingdb/announce.go b/internal/federation/federatingdb/announce.go
index ab230cdfb..0246cff7c 100644
--- a/internal/federation/federatingdb/announce.go
+++ b/internal/federation/federatingdb/announce.go
@@ -19,11 +19,11 @@ package federatingdb
import (
"context"
- "fmt"
"codeberg.org/gruf/go-logger/v2/level"
"github.com/superseriousbusiness/activity/streams/vocab"
"github.com/superseriousbusiness/gotosocial/internal/ap"
+ "github.com/superseriousbusiness/gotosocial/internal/gtserror"
"github.com/superseriousbusiness/gotosocial/internal/log"
"github.com/superseriousbusiness/gotosocial/internal/messages"
)
@@ -46,15 +46,16 @@ 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 gtserror.Newf("error converting announce to boost: %w", err)
}
if !isNew {
- // nothing to do here if this isn't a new announce
+ // We've already seen this boost;
+ // nothing else to do here.
return nil
}
- // it's a new announce so pass it back to the processor async for dereferencing etc
+ // This is a new boost. Process side effects asynchronously.
f.state.Workers.EnqueueFederator(ctx, messages.FromFederator{
APObjectType: ap.ActivityAnnounce,
APActivityType: ap.ActivityCreate,