summaryrefslogtreecommitdiff
path: root/internal/processing/search/lookup.go
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2023-08-02 09:31:09 +0200
committerLibravatar GitHub <noreply@github.com>2023-08-02 08:31:09 +0100
commitcec29e2a8d2d6ca49bb6c789f0ed3226849a7359 (patch)
tree042ba1ddd9d42552403b3a00e224e45e498b962a /internal/processing/search/lookup.go
parent[feature] Allow users to skip http client tls verification for testing purpos... (diff)
downloadgotosocial-cec29e2a8d2d6ca49bb6c789f0ed3226849a7359.tar.xz
[bugfix] Allow instance accounts to be shown in search results in certain circumstances (#2053)
Diffstat (limited to 'internal/processing/search/lookup.go')
-rw-r--r--internal/processing/search/lookup.go14
1 files changed, 13 insertions, 1 deletions
diff --git a/internal/processing/search/lookup.go b/internal/processing/search/lookup.go
index d50183221..8b48d4514 100644
--- a/internal/processing/search/lookup.go
+++ b/internal/processing/search/lookup.go
@@ -44,6 +44,13 @@ func (p *Processor) Lookup(
requestingAccount *gtsmodel.Account,
query string,
) (*apimodel.Account, gtserror.WithCode) {
+ // Include instance accounts in this search.
+ //
+ // Lookup is for one specific account so we
+ // can't return loads of instance accounts by
+ // accident.
+ const includeInstanceAccounts = true
+
// Validate query.
query = strings.TrimSpace(query)
if query == "" {
@@ -96,7 +103,12 @@ func (p *Processor) Lookup(
// using the packageAccounts function to return it. This
// may cause the account to be filtered out if it's not
// visible to the caller, so anticipate this.
- accounts, errWithCode := p.packageAccounts(ctx, requestingAccount, []*gtsmodel.Account{account})
+ accounts, errWithCode := p.packageAccounts(
+ ctx,
+ requestingAccount,
+ []*gtsmodel.Account{account},
+ includeInstanceAccounts,
+ )
if errWithCode != nil {
return nil, errWithCode
}