diff options
author | 2024-03-12 15:34:08 +0100 | |
---|---|---|
committer | 2024-03-12 14:34:08 +0000 | |
commit | 1bcdf1da3bb10d564a6a56a89af5afa53e5cd78f (patch) | |
tree | 83716cea30d236c48e1655193c3adfc232e5bc75 /internal/federation/federatingprotocol.go | |
parent | [chore] Update usage of OTEL libraries (#2725) (diff) | |
download | gotosocial-1bcdf1da3bb10d564a6a56a89af5afa53e5cd78f.tar.xz |
[feature] Process incoming `Move` activity (#2724)
* [feature] Process incoming account Move activity
* fix targetAcct typo
* put move origin account on fMsg
* shift more move functionality back to the worker fn
* simplify error logic
Diffstat (limited to 'internal/federation/federatingprotocol.go')
-rw-r--r-- | internal/federation/federatingprotocol.go | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/internal/federation/federatingprotocol.go b/internal/federation/federatingprotocol.go index f3ab1ae3c..2c2da7b7b 100644 --- a/internal/federation/federatingprotocol.go +++ b/internal/federation/federatingprotocol.go @@ -450,7 +450,11 @@ func (f *Federator) Blocked(ctx context.Context, actorIRIs []*url.URL) (bool, er // // Applications are not expected to handle every single ActivityStreams // type and extension. The unhandled ones are passed to DefaultCallback. -func (f *Federator) FederatingCallbacks(ctx context.Context) (wrapped pub.FederatingWrappedCallbacks, other []interface{}, err error) { +func (f *Federator) FederatingCallbacks(ctx context.Context) ( + wrapped pub.FederatingWrappedCallbacks, + other []any, + err error, +) { wrapped = pub.FederatingWrappedCallbacks{ // OnFollow determines what action to take for this // particular callback if a Follow Activity is handled. @@ -461,7 +465,7 @@ func (f *Federator) FederatingCallbacks(ctx context.Context) (wrapped pub.Federa } // Override some default behaviors to trigger our own side effects. - other = []interface{}{ + other = []any{ func(ctx context.Context, undo vocab.ActivityStreamsUndo) error { return f.FederatingDB().Undo(ctx, undo) }, @@ -476,6 +480,14 @@ func (f *Federator) FederatingCallbacks(ctx context.Context) (wrapped pub.Federa }, } + // Define some of our own behaviors which are not + // overrides of the default pub.FederatingWrappedCallbacks. + other = append(other, []any{ + func(ctx context.Context, move vocab.ActivityStreamsMove) error { + return f.FederatingDB().Move(ctx, move) + }, + }...) + return } |