summaryrefslogtreecommitdiff
path: root/internal/federation/federatingdb/undo.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/federation/federatingdb/undo.go')
-rw-r--r--internal/federation/federatingdb/undo.go14
1 files changed, 8 insertions, 6 deletions
diff --git a/internal/federation/federatingdb/undo.go b/internal/federation/federatingdb/undo.go
index ccf6397cd..b3d158ba6 100644
--- a/internal/federation/federatingdb/undo.go
+++ b/internal/federation/federatingdb/undo.go
@@ -44,13 +44,15 @@ func (f *federatingDB) Undo(ctx context.Context, undo vocab.ActivityStreamsUndo)
l.Debug("entering Undo")
}
- receivingAccount, requestingAccount, internal := extractFromCtx(ctx)
- if internal {
+ activityContext := getActivityContext(ctx)
+ if activityContext.internal {
return nil // Already processed.
}
- var errs gtserror.MultiError
+ requestingAcct := activityContext.requestingAcct
+ receivingAcct := activityContext.receivingAcct
+ var errs gtserror.MultiError
for _, object := range ap.ExtractObjects(undo) {
// Try to get object as vocab.Type,
// else skip handling (likely) IRI.
@@ -61,18 +63,18 @@ func (f *federatingDB) Undo(ctx context.Context, undo vocab.ActivityStreamsUndo)
switch objType.GetTypeName() {
case ap.ActivityFollow:
- if err := f.undoFollow(ctx, receivingAccount, requestingAccount, undo, objType); err != nil {
+ if err := f.undoFollow(ctx, receivingAcct, requestingAcct, undo, objType); err != nil {
errs.Appendf("error undoing follow: %w", err)
}
case ap.ActivityLike:
- if err := f.undoLike(ctx, receivingAccount, requestingAccount, undo, objType); err != nil {
+ if err := f.undoLike(ctx, receivingAcct, requestingAcct, undo, objType); err != nil {
errs.Appendf("error undoing like: %w", err)
}
case ap.ActivityAnnounce:
// TODO: actually handle this !
log.Warn(ctx, "skipped undo announce")
case ap.ActivityBlock:
- if err := f.undoBlock(ctx, receivingAccount, requestingAccount, undo, objType); err != nil {
+ if err := f.undoBlock(ctx, receivingAcct, requestingAcct, undo, objType); err != nil {
errs.Appendf("error undoing block: %w", err)
}
}