diff options
author | 2023-06-03 13:58:57 +0200 | |
---|---|---|
committer | 2023-06-03 13:58:57 +0200 | |
commit | 21c1552daafbcedbd2e19b0c155ff8db9cff2be0 (patch) | |
tree | 00d945280a72d30d51acb618ad7257432d1f9e1a /internal/federation/federatingdb/reject.go | |
parent | [bugfix] Fix first item of thread dereferencing always being skipped (#1858) (diff) | |
download | gotosocial-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.go | 13 |
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) } } |