summaryrefslogtreecommitdiff
path: root/internal/federation/federatingdb/reject.go
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2023-06-03 13:58:57 +0200
committerLibravatar GitHub <noreply@github.com>2023-06-03 13:58:57 +0200
commit21c1552daafbcedbd2e19b0c155ff8db9cff2be0 (patch)
tree00d945280a72d30d51acb618ad7257432d1f9e1a /internal/federation/federatingdb/reject.go
parent[bugfix] Fix first item of thread dereferencing always being skipped (#1858) (diff)
downloadgotosocial-21c1552daafbcedbd2e19b0c155ff8db9cff2be0.tar.xz
[chore] Update versions, fix lint errors (#1860)
Diffstat (limited to 'internal/federation/federatingdb/reject.go')
-rw-r--r--internal/federation/federatingdb/reject.go13
1 files changed, 4 insertions, 9 deletions
diff --git a/internal/federation/federatingdb/reject.go b/internal/federation/federatingdb/reject.go
index ceaee83ef..17f0f84d0 100644
--- a/internal/federation/federatingdb/reject.go
+++ b/internal/federation/federatingdb/reject.go
@@ -70,11 +70,7 @@ func (f *federatingDB) Reject(ctx context.Context, reject vocab.ActivityStreamsR
return errors.New("Reject: follow object account and inbox account were not the same")
}
- if err := f.state.DB.RejectFollowRequest(ctx, followReq.AccountID, followReq.TargetAccountID); err != nil {
- return err
- }
-
- return nil
+ return f.state.DB.RejectFollowRequest(ctx, followReq.AccountID, followReq.TargetAccountID)
}
}
@@ -90,20 +86,19 @@ func (f *federatingDB) Reject(ctx context.Context, reject vocab.ActivityStreamsR
if !ok {
return errors.New("Reject: couldn't parse follow into vocab.ActivityStreamsFollow")
}
+
// convert the follow to something we can understand
gtsFollow, err := f.typeConverter.ASFollowToFollow(ctx, asFollow)
if err != nil {
return fmt.Errorf("Reject: error converting asfollow to gtsfollow: %s", err)
}
+
// make sure the addressee of the original follow is the same as whatever inbox this landed in
if gtsFollow.AccountID != receivingAccount.ID {
return errors.New("Reject: follow object account and inbox account were not the same")
}
- if err := f.state.DB.RejectFollowRequest(ctx, gtsFollow.AccountID, gtsFollow.TargetAccountID); err != nil {
- return err
- }
- return nil
+ return f.state.DB.RejectFollowRequest(ctx, gtsFollow.AccountID, gtsFollow.TargetAccountID)
}
}