diff options
author | 2025-01-28 20:22:23 +0000 | |
---|---|---|
committer | 2025-01-28 20:22:23 +0000 | |
commit | 61141ac2324fd73221f8301ba3805c051bc99fe2 (patch) | |
tree | b05d8cd260a18d174dbad5037b9de8bde7a126a5 /internal/federation/federatingdb/update.go | |
parent | [bugfix] Allow processing null ID emojis (#3702) (diff) | |
download | gotosocial-61141ac2324fd73221f8301ba3805c051bc99fe2.tar.xz |
[chore] remove type switch in Create() and instead move to FederatedCallbacks() (#3697)
* remove type switch in Create() and instead move to FederatedCallbacks()
* add missing (my bad!) federating wrapped callbacks behaviour
* add missing license header :innocent:
* fix create flag test to use correct function
Diffstat (limited to 'internal/federation/federatingdb/update.go')
-rw-r--r-- | internal/federation/federatingdb/update.go | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/internal/federation/federatingdb/update.go b/internal/federation/federatingdb/update.go index a2a9777d1..803c476d6 100644 --- a/internal/federation/federatingdb/update.go +++ b/internal/federation/federatingdb/update.go @@ -43,20 +43,24 @@ import ( func (f *federatingDB) Update(ctx context.Context, asType vocab.Type) error { log.DebugKV(ctx, "update", serialize{asType}) + // Mark activity as handled. + f.storeActivityID(asType) + + // Extract relevant values from passed ctx. activityContext := getActivityContext(ctx) if activityContext.internal { return nil // Already processed. } - requestingAcct := activityContext.requestingAcct - receivingAcct := activityContext.receivingAcct + requesting := activityContext.requestingAcct + receiving := activityContext.receivingAcct if accountable, ok := ap.ToAccountable(asType); ok { - return f.updateAccountable(ctx, receivingAcct, requestingAcct, accountable) + return f.updateAccountable(ctx, receiving, requesting, accountable) } if statusable, ok := ap.ToStatusable(asType); ok { - return f.updateStatusable(ctx, receivingAcct, requestingAcct, statusable) + return f.updateStatusable(ctx, receiving, requesting, statusable) } log.Debugf(ctx, "unhandled object type: %T", asType) |