diff options
author | 2023-08-02 09:31:09 +0200 | |
---|---|---|
committer | 2023-08-02 08:31:09 +0100 | |
commit | cec29e2a8d2d6ca49bb6c789f0ed3226849a7359 (patch) | |
tree | 042ba1ddd9d42552403b3a00e224e45e498b962a /internal/visibility | |
parent | [feature] Allow users to skip http client tls verification for testing purpos... (diff) | |
download | gotosocial-cec29e2a8d2d6ca49bb6c789f0ed3226849a7359.tar.xz |
[bugfix] Allow instance accounts to be shown in search results in certain circumstances (#2053)
Diffstat (limited to 'internal/visibility')
-rw-r--r-- | internal/visibility/account.go | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/internal/visibility/account.go b/internal/visibility/account.go index 6c7a0059d..4d42b5973 100644 --- a/internal/visibility/account.go +++ b/internal/visibility/account.go @@ -19,10 +19,10 @@ package visibility import ( "context" - "fmt" "github.com/superseriousbusiness/gotosocial/internal/cache" "github.com/superseriousbusiness/gotosocial/internal/config" + "github.com/superseriousbusiness/gotosocial/internal/gtserror" "github.com/superseriousbusiness/gotosocial/internal/gtsmodel" "github.com/superseriousbusiness/gotosocial/internal/log" ) @@ -66,7 +66,7 @@ func (f *Filter) isAccountVisibleTo(ctx context.Context, requester *gtsmodel.Acc // Check whether target account is visible to anyone. visible, err := f.isAccountVisible(ctx, account) if err != nil { - return false, fmt.Errorf("isAccountVisibleTo: error checking account %s visibility: %w", account.ID, err) + return false, gtserror.Newf("error checking account %s visibility: %w", account.ID, err) } if !visible { @@ -83,7 +83,7 @@ func (f *Filter) isAccountVisibleTo(ctx context.Context, requester *gtsmodel.Acc // If requester is not visible, they cannot *see* either. visible, err = f.isAccountVisible(ctx, requester) if err != nil { - return false, fmt.Errorf("isAccountVisibleTo: error checking account %s visibility: %w", account.ID, err) + return false, gtserror.Newf("error checking account %s visibility: %w", account.ID, err) } if !visible { @@ -97,7 +97,7 @@ func (f *Filter) isAccountVisibleTo(ctx context.Context, requester *gtsmodel.Acc account.ID, ) if err != nil { - return false, fmt.Errorf("isAccountVisibleTo: error checking account blocks: %w", err) + return false, gtserror.Newf("error checking account blocks: %w", err) } if blocked { @@ -121,6 +121,7 @@ func (f *Filter) isAccountVisible(ctx context.Context, account *gtsmodel.Account // Fetch the local user model for this account. user, err := f.state.DB.GetUserByAccountID(ctx, account.ID) if err != nil { + err := gtserror.Newf("db error getting user for account %s: %w", account.ID, err) return false, err } |